public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/36279] New: division by zero in #if
@ 2008-05-20 14:00 aldot at gcc dot gnu dot org
2008-05-20 14:32 ` [Bug preprocessor/36279] " schwab at suse dot de
0 siblings, 1 reply; 2+ messages in thread
From: aldot at gcc dot gnu dot org @ 2008-05-20 14:00 UTC (permalink / raw)
To: gcc-bugs
$ cat argh.h
#define __x(y) __NR_##y
#define x(y) __x(y)
/* define HAVE_FOO if __NR_XXX is defined: */
#define __NR_read 0
#undef __NR_write
#ifdef BUG2
#define __NR_ac%scess 1
#endif
#if defined XXX
# if x(XXX) >= 0
# define HAVE_FOO 1
# warning HAVE_FOO
# else
# undef HAVE_FOO
# warning no FOO
# endif
#endif
$ echo | gcc-4.4-trunk -DXXX=acce%ss -include argh.h -c - -E -P
In file included from <command-line>:0:
./argh.h:11:13: error: division by zero in #if
./argh.h:13:4: warning: #warning HAVE_FOO
Another (alleged) one, BUG2:
$ echo | gcc-4.4-trunk -DBUG2 -DXXX=read -include argh.h -c - -E -P
In file included from <command-line>:0:
./argh.h:7:16: warning: missing whitespace after the macro name
./argh.h:13:4: warning: #warning HAVE_FOO
And something that would be handy to have but that doesn't seem to work for me:
This is Ok, __NR_read is defined:
$ echo | gcc-4.4-trunk -DXXX=read -include argh.h -c - -E -P
In file included from <command-line>:0:
./argh.h:13:4: warning: #warning HAVE_FOO
This is not OK, i'd expect this to be "no FOO" since __NR_write is *not*
defined:
$ echo | gcc-4.4-trunk -DXXX=write -include argh.h -c - -E -P
In file included from <command-line>:0:
./argh.h:13:4: warning: #warning HAVE_FOO
--
Summary: division by zero in #if
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: aldot at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36279
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug preprocessor/36279] division by zero in #if
2008-05-20 14:00 [Bug preprocessor/36279] New: division by zero in #if aldot at gcc dot gnu dot org
@ 2008-05-20 14:32 ` schwab at suse dot de
0 siblings, 0 replies; 2+ messages in thread
From: schwab at suse dot de @ 2008-05-20 14:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from schwab at suse dot de 2008-05-20 14:31 -------
Undefined identifiers are replaced by 0 in #if.
--
schwab at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36279
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-20 14:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-20 14:00 [Bug preprocessor/36279] New: division by zero in #if aldot at gcc dot gnu dot org
2008-05-20 14:32 ` [Bug preprocessor/36279] " schwab at suse dot de
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).