escape a ? that follows a ? in string literals
Under -std=c11 C reads trigraphs, which Sex has none of: "??=" came out "#", and "??/" before the closing quote left the string open.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
(compilation "-- -std=c11 -pedantic-errors")
|
||||
(input)
|
||||
(output "c11: 42 43 6 4 6 12")
|
||||
(output "c11: 42 43 6 4 6 12"
|
||||
"trigraphs: what??! ??= ???( ??/")
|
||||
(return 0)
|
||||
|
||||
;;; C11 is the floor, and this is the program that holds it there: the
|
||||
@@ -12,6 +13,10 @@
|
||||
;;; max_align_t in the environment and `_Static_assert' on its size;
|
||||
;;; the record, the method and the match are here for what they emit,
|
||||
;;; and the globals for initializers that have to be constants.
|
||||
;;;
|
||||
;;; It is also the one mode where C still reads trigraphs, which Sex has
|
||||
;;; none of: a string says what was written, `??/' before its closing
|
||||
;;; quote included.
|
||||
|
||||
(include stdio.h)
|
||||
|
||||
@@ -42,4 +47,5 @@
|
||||
(printf "c11: %d %d %d %d %d %d\n"
|
||||
(.area p) (add-k (.area p)) (+ (sides (shape/square 1)) (sides (shape/dot)) 2)
|
||||
(sides unit) (.area corner) (.area [pair 1]))
|
||||
(printf "trigraphs: %s\n" "what??! ??= ???( ??/")
|
||||
(return 0))
|
||||
|
||||
Reference in New Issue
Block a user