This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/12221] fstream.tcc:463: error: expected unqualified-id


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12221



------- Additional Comments From alexander dot riesen at synopsys dot com  2003-09-09 10:27 -------
Subject: Re:  fstream.tcc:463: error: expected unqualified-id

gdr at integrable-solutions dot net, Tue, Sep 09, 2003 12:18:32 +0200:
> 
> | For such code:
> | 
> | #include <algorithm>
> | // some header file doing #define:
> | #define min(a,b) ((a)<(b)?(a): (b))
> | #include <fstream>
> 
> This is not a problem in the library.  The code is simply bogus. 
> min is a reserved name.  This PR should be resolved invalid.
> 

I'm not saying the library is wrong.

Of course the code _is_ bogus! The problem is, there is a lot of
such code out there.

If the PR is invalid, why there is "undef min" (and max) in the
stl_algobase.h, line 128?

Can there be any help for a sore programmer confronting the problem next
time? Just a hint to help to identify the place where the macro
redefines a reserved word?

-alex


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]