[sv-bc] P1800 draft2 review -- What's the scope of `define?

From: Gran, Alex <alex_gran_at_.....>
Date: Mon Apr 02 2007 - 11:49:01 PDT
Question from my review of Sec 21:
 
Section 21.1 makes this general statement about the scope of compiler
directives:
 
        The scope of a compiler directive extends from the point where
it is processed, across all files processed in the

        current compilation unit, to the point where another compiler
directive supersedes it or the processing of the

        compilation unit completes.

 

Sec 21.4.1 Says this specifically about `define

        Once a text macro name has been defined, it can be used anywhere
in a source description; that is, there are
        no scope restrictions. Implementations may also allow text
macros can to be defined and used interactively.

 

It looks like the text from 21.4.1 came from 1364 where the concept of
'compilation units' didn't exist. Do we really want the sentence in
21.4.1 to say something like this?

        Once a text macro name has been defined, it can be used anywhere
in the compilation unit where it is defined; There are
        no other scope restrictions once inside the compilation unit.

I'm not in a position where I can try the majority of the vendor
implementations to get a consensus on how this is currently actually
implemented, I'm just going by the language in the LRM.

~Alex

 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Apr 2 11:53:23 2007

This archive was generated by hypermail 2.1.8 : Mon Apr 02 2007 - 11:53:43 PDT