public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* preprocessor/3726: macro expansion min(a,b) conflicts with min() function
@ 2001-07-18 4:36 thomas.hiller
0 siblings, 0 replies; 2+ messages in thread
From: thomas.hiller @ 2001-07-18 4:36 UTC (permalink / raw)
To: gcc-gnats; +Cc: wilhelm.nuesser
>Number: 3726
>Category: preprocessor
>Synopsis: macro expansion min(a,b) conflicts with min() function
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jul 18 04:36:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: thomas.hiller@sap.com
>Release: gcc-3.0 (including 20010716)
>Organization:
>Environment:
ia64 and ia32
>Description:
When I have defined the min (and max) macro to have two arguments,
should the preprocessor also expand int min() {} ?
If yes, it conflicts with the class numeric_limits from libstdc++.
Is it no longer possible to use the min/max macros with c++ ?
This is the reason for libstdc++/3658
min() gets expanded to min and in the following the syntax become
wrong.
>How-To-Repeat:
#ifndef min
#define min(a,b) (((a) <= (b)) ? (a) : (b))
#endif
int min() {}
Just compile these lines. I would expect no macro argument error.
Tests on SUN with SUNcc didn't show the argument errors.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: preprocessor/3726: macro expansion min(a,b) conflicts with min() function
@ 2001-07-18 9:23 neil
0 siblings, 0 replies; 2+ messages in thread
From: neil @ 2001-07-18 9:23 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, thomas.hiller, wilhelm.nuesser
Synopsis: macro expansion min(a,b) conflicts with min() function
State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Wed Jul 18 09:23:53 2001
State-Changed-Why:
Not a bug - it is a macro and so expands. You should do someting else
in your case.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3726&database=gcc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-07-18 9:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-18 4:36 preprocessor/3726: macro expansion min(a,b) conflicts with min() function thomas.hiller
2001-07-18 9:23 neil
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).