This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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 libc/12153] use of keywords in macro definitions can make compilation fail


http://sourceware.org/bugzilla/show_bug.cgi?id=12153

Vincent LefÃvre <vincent+libc at vinc17 dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|WONTFIX                     |
     Ever Confirmed|1                           |0

--- Comment #6 from Vincent LefÃvre <vincent+libc at vinc17 dot org> 2010-10-22 19:03:31 UTC ---
(In reply to comment #4)
> There's an example of a possible definition for fpclassify in 7.12.3.1#4 
> that uses the keywords sizeof, float and double.

I noticed that, but I'd say that could be the example that is buggy (and in any
case, it is not normative).

> Clearly if the committee actually intended macro definitions of keywords to
> be valid when macros from standard headers are used they'd have allowed for
> it in such examples in the standard and the Rationale.

The committee's intent is not clear, as 7.1.2#4 says: "The program shall not
have any macros with names lexically identical to keywords currently defined
prior to the inclusion." If the intent was to disallow such macro definitions
completely, the standard would not have said "prior to the inclusion". The fact
that the committee said "prior to the inclusion" implies that they knew that
such macros could be defined after the inclusion and didn't want to disallow
them. Perhaps the committee didn't think about the consequences on macros,
though.

(In reply to comment #5)
> If you redefine reserved words and then use any part of the system, it's your
> own fault.

The point is that
1. keywords are not reserved until translation phases 7 and 8 (and the standard
documents when such keywords can't be used as macro names);
2. the user doesn't use the keyword in his code (the use of a keyword by a
standard macro is hidden).

If you disagree with the standard, then you should submit a defect report.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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