std C/C++ patch #11
David Scott Page
page at cs.utexas.edu
Tue Apr 30 17:22:45 EDT 2002
Eddie,
This is probably getting a bit arcane for general click interest...
>From the Sun cc manpage:
-X[c|a|t|s]
Specifies the degree of conformance to the ANSI/ISO C
standard. Specifies one of the following:
c (conformance)
Strictly conformant ANSI/ISO C, without K&R C com-
patibility extensions. The compiler will issue
errors and warnings for programs that use non-
ANSI/ISO C constructs. The predefined macro
__STDC__ has a value of one with the -Xc option.
a (ANSI)
ANSI C plus K&R C compatibility extensions, with
semantic changes required by ANSI C. Where K&R C
and ANSI C specify different semantics for the
same construct, the compiler uses the ANSI C
interpretation. If the -Xa option is used in con-
junction with the -xtransition option, the com-
piler issues warnings about the different seman-
tics. This is the default compiler mode. The
predefined macro __STDC__ has a value of zero with
the -Xa option.
...
Sun cc -Xa corresponds to what happens with KCC --c, and -Xc to KCC --c
--strict.
KCC and Sun CC define __STDC__=0 (perhaps in the spirit of C++
defining something close to ansi C with "extensions").
So, these would seem to be the most reasonable alternatives:
1. Change this particular (u)int64_t to (unsigned) long long (per grep,
there are 132 occurences of "int64_t" in click vs. 111 of "long
long" --- which, appears to depend on the target of the code).
2. My dropping the "--strict" flag for KCC --c (the C compiler only).
I suspect (2) is the way to go, as it is the default mode of KCC --c
and Sun cc, and generally introduces the (u)int64_t types for C, which
I think we both think is reasonable.
--
Scott Page
More information about the click
mailing list