Path: utzoo!attcan!uunet!husc6!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.std.c Subject: Re: __STDC__ and non-strictly conforming ANSI C compilers Message-ID: <9237@smoke.BRL.MIL> Date: 27 Dec 88 06:14:18 GMT References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL> <12643@bellcore.bellcore.com> <9187@smoke.BRL.MIL> <11005@ulysses.homer.nj.att.com> <9199@smoke.BRL.MIL> <1988Dec18.043804.907@utzoo.uucp> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 26 In article <1988Dec18.043804.907@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >(Speaking as such a software writer, I do *not* consider the suggestion >of doing an explicit -D__STDC__=1 every time to be helpful. I don't >have to do this after every #define, I don't want to have to do it after >every -D in my Makefile either.) There must be something wrong with your Makefiles, then. For a large project, each Makefile should contain something like include ../../Make.defs (actually we use three includable pieces in our biggest project) so that things like CC and CFLAGS can be defined IN ONE PLACE as appropriate for the target environment: CC = /usr/local/bin/ansi_cc or CC = cc -ANSI -D__STDC__=1 # or whatever or CFLAGS = -ANSI -D__STDC__=1 # or whatever (/usr/local/bin/ansi_cc can be a shell script that supplies the necessary flags to enter the standard-conforming mode.) There is a lot more one could say about such configuration, but this should be enough to demonstrate that "cc" by itself need not be ANSI-conforming even if it provides (part of) the way one invokes an ANSI-conforming compiler.