Topic: Defect report: user defined macros and standard headers.


Author: James.Kanze@dresdner-bank.com
Date: 11 Jan 01 09:43:21 GMT
Raw View
 [Moderator's note: this defect report has been
 forwarded to the C++ committee. -moderator(fjh).]

Section 17.4.3.1.1 [lib.macro.names] paragraph 2:

This paragraph says: "A translation unit that includes a header shall
not contain any macros that define names declared in that header."  As
I read this, it would mean that the following program is legal:

    #define npos 3.14
    #include <sstream>

since npos is not defined in <sstream>.  It is, however, defined in
<string>, and it is hard to imagine an implementation in which
<sstream> didn't include <string>.

I think that this phrase was probably formulated before it was decided
that a standard header may freely include other standard headers.  The
phrase would be perfectly appropriate for C, for example.  In light of
17.4.4.1[lib.res.onheaders]/1, however, I think it should read: "A
translation unit that includes a header shall not contain any macros
that define names declared in any standard header."

--
James Kanze                               mailto:kanze@gabi-soft.de
Conseils en informatique orient   e objet/
                   Beratung in objektorientierter Datenverarbeitung
Ziegelh   ttenweg 17a, 60598 Frankfurt, Germany Tel. +49(069)63198627


Sent via Deja.com
http://www.deja.com/
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]