From: Andris Pavenis To: djgpp-workers AT delorie DOT com, Hans-Bernhard Broeker Subject: Re: conio.h bug? Date: Tue, 1 Jul 2003 15:22:57 +0300 User-Agent: KMail/1.5.2 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200307011522.57814.pavenis@latnet.lv> Reply-To: djgpp-workers AT delorie DOT com On Tuesday 01 July 2003 11:22, Hans-Bernhard Broeker wrote: > News Reader wrote: > > 1) Compiler error received: > > > > In file included from test.c:1: > > c:/ab/djgpp/include/conio.h:74: error: > > nonnull argument references non-pointer operand (arg 1, operand 1) > > [Later clarified that this only happens with GCC-3.3, not earlier > versions]. > > > 3) Line 74 in header file: > > > > int gettext(int _left, int _top, int _right, int _bottom, void > > *_destin); > > This is the 2.03 version of conio.h. In 2.04alpha, this function is > renamed to _conio_gettext, to avoid a conflict with from > GNU gettext, the program localization toolset. > > To me, this sounds more like a potential bug in GCC-3.3 or its port > than a bug in conio.h --- that source line appears to be completely > correct, and the error message makes no sense whatsoever. > > It might help to check preprocessor output for this, i.e.: > > gcc -E -dD test.c > test.i > > and inspect test.i closely. Particularly check what became of line 74 > of conio.h. > > Andris: did you put any machinery into the 3.3 port to deal with the > gettext() ambiguity? Maybe in some pre-loaded header? No. I haven't done anything with it. Did tests under Linux with gcc-3.4 20030630 (experimental) and gcc-3.3.1 20030627 (prerelease) Results are below. So it's not a DJGPP only problem. gettext appears in file gcc/builtin-attrs.def for CVS at least beginning with gcc-3.2 branch (haven't looked earlier). Andris andris AT geomets2:/disk2/cvs/gcc/3.4/build/build.lnx/gcc$ cat ~/bad.c int gettext(int _left, int _top, int _right, int _bottom, void *_destin); andris AT geomets2:/disk2/cvs/gcc/3.4/build/build.lnx/gcc$ xgcc -v -B ./ -c ~/bad.c Reading specs from ./specs Configured with: ../gcc/configure --prefix=/disk2/gcc34 --enable-shared --verbose --enable-languages=c,c++,f77,objc,ada --enable-threads=posix Thread model: posix gcc version 3.4 20030630 (experimental) ./cc1 -quiet -v -iprefix /disk2/cvs/gcc/3.4/build/build.lnx/gcc/../lib/gcc-lib/i686-pc-linux-gnu/3.4/ -isystem ./include /home/andris/bad.c -quiet -dumpbase bad.c -mtune=pentiumpro -auxbase bad -version -o /tmp/ccyKdGO1.s ignoring nonexistent directory "/disk2/cvs/gcc/3.4/build/build.lnx/lib/gcc-lib/i686-pc-linux-gnu/3.4/include" ignoring nonexistent directory "/disk2/cvs/gcc/3.4/build/build.lnx/lib/gcc-lib/i686-pc-linux-gnu/3.4/../../../../i686-pc-linux-gnu/include" ignoring nonexistent directory "/disk2/gcc34/include" ignoring nonexistent directory "/disk2/gcc34/lib/gcc-lib/i686-pc-linux-gnu/3.4/include" ignoring nonexistent directory "/disk2/gcc34/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: include /usr/local/include /usr/include End of search list. GNU C version 3.4 20030630 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 3.4 20030630 (experimental). GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64398 /home/andris/bad.c:1: error: nonnull argument references non-pointer operand (arg 1, operand 1) /home/andris/bad.c:1: error: nonnull argument references non-pointer operand (arg 1, operand 1) andris AT geomets2:/disk2/cvs/gcc/3.4/build/build.lnx/gcc$ cd ../../../../3.3/build/build.lnx/gcc andris AT geomets2:/disk2/cvs/gcc/3.3/build/build.lnx/gcc$ xgcc -v -B ./ -c ~/bad.c Reading specs from ./specs Configured with: ../gcc/configure --prefix=/disk2/gcc33 --enable-shared --verbose --enable-languages=c,c++,f77,objc,ada --enable-threads=posix Thread model: posix gcc version 3.3.1 20030627 (prerelease) ./cc1 -quiet -v -iprefix ./../lib/gcc-lib/i686-pc-linux-gnu/3.3.1/ -isystem ./include -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 /home/andris/bad.c -quiet -dumpbase bad.c -auxbase bad -version -o /tmp/ccG3GUGd.s GNU C version 3.3.1 20030627 (prerelease) (i686-pc-linux-gnu) compiled by GNU C version 3.3.1 20030627 (prerelease). GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64398 ignoring nonexistent directory "../lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include" ignoring nonexistent directory "../lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../../i686-pc-linux-gnu/include" ignoring nonexistent directory "/disk2/gcc33/include" ignoring nonexistent directory "/disk2/gcc33/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include" ignoring nonexistent directory "/disk2/gcc33/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: include /usr/local/include /usr/include End of search list. /home/andris/bad.c:1: error: nonnull argument references non-pointer operand (arg 1, operand 1) /home/andris/bad.c:1: error: nonnull argument references non-pointer operand (arg 1, operand 1)