I've got some (legacy) code that I'm building with clang for the first time. The code is something like:
sprintf(buf, "%s <%s ????>", p1, p2);
Clang gives the following warning (error with -Werror
):
test.c:6:33: error: trigraph converted to '}' character [-Werror,-Wtrigraphs]
sprintf(buf, "%s <%s ????>", p1, p2);
^
Clearly the ??>
is not intended as a trigraph, so I want to disable trigraphs entirely (the source does not intentionally use them anywhere).
I have tried -no-trigraphs
but that's not really an option:
clang: warning: argument unused during compilation: '-no-trigraphs'
I can turn off the trigraphs warning with -Wno-trigraphs
but I don't want the trigraph conversion to actually take place at all.
NOTE: Trigraphs were enabled as an unintended side effect of using -std=c89
.
-trigraphs
. Time to break outsed
? Or an equivalent. – Extenuation-std=c89
,-std=c99
, etc) do turn on trigraph conversion. – Ruffianism-Wtrigraphs
to my uber-fussy compilation options for a while, or go grepping, I suppose, but I've not seen any problems so it is unlikely to afflict me. – Extenuation-Wtrigraphs
is on by default as long as you don't request trigraph conversion (explicitly or implicitly). – Ruffianism