;;;; A NUL as a string's last byte, handed to C. Only a literal crosses ;;;; uncopied, and only because the checker marks it at the call; a string that ;;;; merely ends in a NUL is copied like any other, and the NUL inside it is ;;;; refused. Each argument is one way to spell such a string, and each is ;;;; refused naming the call. (declare-c c-puts [s string] i32 "puts") (defn main [args [string]] i32 (let [which (if (> (length args) 1) (bytes->i64 (bytes-view (at args 1))) 0)] (println "before") (cond (= which 1) (let [s "ab\0"] (c-puts s)) (= which 2) (c-puts (string (slice (bytes-view "ab\0c") 0 3))) (= which 3) (c-puts (string (bytes "q\0"))) :else (c-puts "ab\0")) (println "unreachable")) 0)