name space 
Author Message
 name space

Hi
Should this be considered an error? I thought typedefs are in different name
space than ordinary identifiers....

typedef char c;
c c;



Thu, 08 Jan 2004 06:48:10 GMT  
 name space


Quote:
> Hi
> Should this be considered an error? I thought typedefs are in different
name
> space than ordinary identifiers....

> typedef char c;
> c c;

Why on earth would you do that?

Tom



Thu, 08 Jan 2004 07:07:12 GMT  
 name space

Quote:

>Hi
>Should this be considered an error? I thought typedefs are in different name
>space than ordinary identifiers....

No, they are in the same namespace.

Looked at another way, an identifier in C can have four independent
bindings:

        - the name of a object, function or typedef
        - goto label
        - struct, union or enum tag
        - macro



Thu, 08 Jan 2004 07:10:52 GMT  
 name space

Quote:
> No, they are in the same namespace.

> Looked at another way, an identifier in C can have four independent
> bindings:

> - the name of a object, function or typedef
> - goto label
> - struct, union or enum tag
> - macro

Shouldn't MACROs be processed by preprocessor instead?


Thu, 08 Jan 2004 07:26:24 GMT  
 name space

Quote:

>> No, they are in the same namespace.

>> Looked at another way, an identifier in C can have four independent
>> bindings:

>> - the name of a object, function or typedef
>> - goto label
>> - struct, union or enum tag
>> - macro

>Shouldn't MACROs be processed by preprocessor instead?

By the what?


Thu, 08 Jan 2004 07:55:17 GMT  
 name space

Quote:
> By the what?

by cpp, the pre-processor.


Thu, 08 Jan 2004 13:33:46 GMT  
 name space

Quote:

>> By the what?

>by cpp, the pre-processor.

I can't find these terms in the index of the C90 standard.  There are
``preprocessing concatenation'', ``preprocessing directives'',
``preprocessing numbers'' and ```preprocessing tokens''.  But no
``preprocessor''.

I don't understand what you are trying to say. Do you have something to
add to my saying that C identifers have an independent binding to macros,
so that a name which is used for a macro can be used for other things
at the same time?



Thu, 08 Jan 2004 13:54:55 GMT  
 name space

Quote:


> >> By the what?

> >by cpp, the pre-processor.

> I can't find these terms in the index of the C90 standard.  There are
> ``preprocessing concatenation'', ``preprocessing directives'',
> ``preprocessing numbers'' and ```preprocessing tokens''.  But no
> ``preprocessor''.

It does, however, appear in the index of C99, and I quote:

        macro preprocessor, 6.10

The term "preprocessor" doesn't seem to appear in section 6.10 itself,
however, presumably because the committee felt that putting "macro
preprocessor" in the index and pointing to this section would be
sufficient to make their intent crystal clear.

<grin alignment="lawful evil">
Is the index normative?
</grin>

--

"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton



Thu, 08 Jan 2004 20:32:29 GMT  
 name space
Where did you guys get the standard?
Thanks


Fri, 09 Jan 2004 11:13:07 GMT  
 name space

Quote:

>Where did you guys get the standard?

http://www.comeaucomputing.com/iso contains a link
to where you can get the standard.
--
Greg Comeau                 Countdown to "export": December 9, 2001
Comeau C/C++ ONLINE ==>     http://www.comeaucomputing.com/tryitout
NEW: Try out libcomo, now for Windows too! Try out our C99 mode!
Special July "2fer", see http://www.comeaucomputing.com


Fri, 09 Jan 2004 11:19:25 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. name space

2. System.Web.Mail name space

3. Q: Name Space Clashes in Libraries ??

4. name-space conflicts

5. in what name space is class DataAdapterDesigner?

6. P2P Name-Space Project Need Comments

7. ANSI name space on Power Macintosh?

8. ANSI name space on Power Macintosh?

9. Help wanted on avoiding name space pollution

10. ANSI name space requirements/limitations

11. Invalid IInternetProtocolSink in Name-space Handler?

12. Is this ok? abount name spaces

 

 
Powered by phpBB® Forum Software