In Tru64 autoconf likes to select "-std1" as the flag to get an ANSI
compiler.
I think that change was proposed by Kevin Ryde in June
<http://mail.gnu.org/archive/html/autoconf-patches/2003-06/msg00009.html>
and was later installed into Autoconf. The problem is that plain "cc"
mishandles \x escapes in strings.
The problem is that this is similar to the "-ansi" switch in
GCC, and it turns off useful extensions.
What extensions are these? Is this documented anywhere?
The normal and recommended switch would be just "-std".
Besides \x,
<http://groups.google.com/groups?selm=9ro8ef%2427l6%241%40FreeBSD.csie.NCTU.edu.tw>
says that Tru64 "cc -std" defines __STDC__ to be 0. It's clearly more
conservative to use -std1, but perhaps if -std1 disables some useful
extensions then we should revisit this issue.
-std
Selects the relaxed ANSI language mode. Enforces the ANSI C
standard,
but allows some common programming practices disallowed by the stan-
dard.
This option does not restrict the Tru64 UNIX name space (for
example,
the names defined in system header files). To restrict that name
space
so that only ANSI C reserved names are visible from the ANSI C
header
files, use the _ANSI_C_SOURCE macro. See standards(5) for more
details.
This option causes the macro __STDC_ to be defined to 0.
-std0
Selects the K & R language mode. This is the default. Enforces
the K &
R programming style, with certain ANSI extensions in areas where
the K
& R behavior is undefined or ambiguous. In general, -std0
compiles most
pre-ANSI C programs and produces expected results. The -std0 option
causes the __STDC__ macro to be undefined.
-std1
Selects the strict ANSI language mode. Strictly enforces the ANSI C
standard and all its prohibitions (such as those that apply to
the han-
dling of void types, the definition of lvalues in expressions,
the mix-
ing of integrals and pointers, and the modification of rvalues).
This option does not restrict the Tru64 UNIX name space (for
example,
the names defined in system header files). To restrict that name
space
so that only ANSI C reserved names are visible from the ANSI C
header
files, use the _ANSI_C_SOURCE macro. See standards(5) for more
details.
This option causes the macro __STDC_ to be defined to 1. Note
that this
option also affects linker-defined symbols. See ld(1) for more
infor-
mation.
This option, combined with -O3 or higher, turns on ANSI aliasing
rules
(-ansi_alias option).