J
Jun Woong
Dan Pop said:Well, the implementor can "shadow" each keyword by an alias with the same
name, but prefixed by a double underscore and use the aliases in the
standard headers.
It's doubtful how many implementations provide such built-in "shadows"
and how many implementers even know that they should not use keywords
in implementing macros for the standard library. In this sense, it's
surely tricky, and I'd be happy if the committee decides to prohibit
masking keywords.
The things get hairy only for people trying to provide "portable"
implementations of the standard library, because they can't afford this
luxury. The standard types can be easily typedef'ed to reserved
identifiers, but there is no similar workaround for the other keywords.
One important example is sizeof, as I mentioned, which is an operator
and very useful when making macros for some standard functions imitate
the functions' behavior more well.