X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3F9A5FB3.9178B63@phekda.freeserve.co.uk> Date: Sat, 25 Oct 2003 12:34:11 +0100 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: -ansi breaks gpp? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello. Kushal Kumaran wrote: > > I am unable to use the -ansi switch with the most trivial C++ > programs: > > -- Begin test.cc > #include > > int main() { > } > -- End test.cc > > -- Begin compilation transcript (copied and pasted from Emacs) > cd c:\foo\cc\ > gpp -v -ansi -o test.exe test.cc > Reading specs from c:/djgpp/lib/gcc-lib/djgpp/3.32/specs > Configured with: /devel/gnu/gcc/3.3/gnu/gcc-3.32/configure > i586-pc-msdosdjgpp --prefix=/dev/env/DJDIR --disable-nls > Thread model: single > gcc version 3.3.2 > > c:/djgpp/lib/gcc-lib/djgpp/3.32/cc1plus.exe -quiet -v -D__GNUC__=3 -D_ > _GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=2 -remap -imacros > c:/djgpp/lib/gcc-lib/djgpp/3.32/djgpp.ver > test.cc -D__GNUG__=3 -quiet -dumpbase test.cc -ansi -auxbase > test -ansi -version -o c:/djgpp/tmp/cc2dYfBE.s > GNU C++ version 3.3.2 (djgpp) > compiled by GNU C version 3.3.2. > GGC heuristics: --param ggc-min-expand=30 --param > ggc-min-heapsize=4096 > ignoring nonexistent directory "c:/djgpp/djgpp/include" > #include "..." search starts here: > #include <...> search starts here: > c:/djgpp/lang/cxx/3.32 > c:/djgpp/lang/cxx/3.32/djgpp > c:/djgpp/lang/cxx/3.32/backward > c:/djgpp/lib/gcc-lib/djgpp/3.32/include > c:/djgpp/include > End of search list. > In file included from test.cc:1: > c:/djgpp/lang/cxx/3.32/cmath:107: error: `acosf' not declared [snip] DJGPP is not C99-compliant. The g++ headers are trying to use declarations of C99 functions. DJGPP 2.04 will be more C99-compliant. But it still may not work. I'll see if I can fix the development version (in CVS) this weekend. > > The problem goes away if > 1. certain headers are not included(including only string works, > iostream doesn't) > 2. -ansi switch is not used, or > 3. C programs are compiled, with or without -ansi. > > Am I doing something wrong? Does the -ansi switch simply not work > with C++? I couldn't find any references to the -ansi switch at > google. Nope, it doesn't work. > Also, in the above messages, there is a complaint about 'nonexistent > directory "c:/djgpp/djgpp/include"'. Where does this come from? I > removed > my djgpp directory and unzipped just djdev203, bnu214, gcc332, gpp332 > and tried again, with the same errors. I suspect one of the include file search paths built into the compiler is bogus. I can't see one, from your output with -v, though. Weird. This is what I have for my search paths: bash-2.04$ echo | gpp -v -E - Reading specs from c:/djgpp/lib/gcc-lib/djgpp/3.23/specs Configured with: /devel/gnu/gcc/3.2/gnu/gcc-3.23/configure i586-pc-msdosdjgpp -- prefix=/dev/env/DJDIR --disable-nls Thread model: single gcc version 3.2.3 c:/djgpp/lib/gcc-lib/djgpp/3.23/cpp0.exe -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102 -D__MSDOS__ -D__GO32__ -D__DJGPP__=2 -D__unix__ -D__MSDOS__ -D__GO32__ -D__DJGPP__=2 -D__unix__ -Asystem=msdos -Asystem=unix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i586__ -D__tune_pentium__ -DMSDOS -DGO32 -DDJGPP=2 -Dunix -remap -imacros c:/djgpp/lib/gcc-lib/djgpp/3.23/djgpp.ver - GNU CPP version 3.2.3 (cpplib) (80386, BSD syntax) ignoring nonexistent directory "c:/djgpp/djgpp/include" #include "..." search starts here: #include <...> search starts here: c:/djgpp/lib/gcc-lib/djgpp/3.23/include c:/djgpp/include End of search list. # 1 "" # 1 "" # 1 "" # 1 "c:/djgpp/lib/gcc-lib/djgpp/3.23/djgpp.ver" 1 # 1 "c:/djgpp/include/sys/version.h" 1 3 # 2 "c:/djgpp/lib/gcc-lib/djgpp/3.23/djgpp.ver" 2 # 2 "" 2 # 1 "" Bye, Rich =] -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ] "You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek