On 11/19/19 8:43 PM, Keith Medcalf wrote:

If using a GCC compiler, the dialect is -std=gnuXX where XX is the latest year 
supported by the compiler.
In order these are: gnu89 gnu90, gnu9x, gnu99, gnu11, gnu1x, gnu17, gnu18, 
gnu19, gnu20, gnu2x

This also happens to be the default if you do not specify -std

The Source Code does NOT contain #ifdef's to "turn off" GNU extensions when a 
GNU compiler is being used, so if you are using a GNU compiler you MUST use it in a GNU 
compliant mode.  The actual version that is required when using a GNU compiler is 
probably gnu89, that is, ANSI C with GNU extensions.


I was waiting for the right person to respond. You are the right person.
I generally, these days, wait until I see the names and voices that I
have heard over the past ten or twenty years and then I really do pay
attention. You Sir are the man today.  :)  So thank you.

So you are saying that the code base is C89 clean but one should not
or must not attempt to compile with a GCC compiler and specify a std
such as -std=iso9899:1999 because the codebase makes no attempt to
detect the GNU compiler?  I am confused.  Regardless my own experience
and understanding is that the sqlite code is so clean that I could print
it out onto the walls of a room and we have have a surgical theatre
ready for heart transplant.  However there is no such standard as "GNU
compliant" and there seems to be things in the codebase that are just
strange enough that I can not compile the code on a Red Hat Enterprise
Linux machine with gcc 9.2.0. Having said all that you are saying "don't
do that" and just let the code compile as is with a very few switches
but certainly not -std=foo. With sqlite-src-3300100 I can not get very
far due to the testsuite blowing up with a segfault :

# WARNING: This next test takes around 12 seconds
gmake: *** [Makefile:1256: tcltest] Segmentation fault (core dumped)

Now here I do want and need the ability to debug and thus my CFLAGS are:

CC=/opt/bw/gcc9/bin/gcc

CFLAGS=-std=iso9899:1999 -O0 -m64 -g -march=k8 -mtune=k8 \
-Wl,-rpath=/opt/bw/lib,--enable-new-dtags -fno-builtin \
-malign-double -mpc80

CPPFLAGS=-I/opt/bw/include -D_POSIX_PTHREAD_SEMANTICS \
-D_LARGEFILE64_SOURCE -D_TS_ERRNO -D_GNU_SOURCE

I can get a compile and never a test.

I think my real issue here is that I can get everything to compile
neatly on some other system such as good ol' strict POSIX Solaris 10
with the Oracle Studio 12.6 tools and that is with insanely strict
C99 compiler but can not get a good result on RHEL.  Which is maddening.
Even with a new shiney gcc.

Would love to hear your thoughts.


--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to