Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: howmany -- What the F**k ? |
| Date | 2015-11-22 16:15 -0500 |
| Organization | Self |
| Message-ID | <56523083.4060404@verizon.net> (permalink) |
| References | (2 earlier) <MPG.30bae728ff5b26669a@news.eternal-september.org> <5651DAA1.6030609@verizon.net> <MPG.30bba6c41628ff09e@news.eternal-september.org> <56521000.5010102@verizon.net> <MPG.30bbcd5a9c3bf2dea1@news.eternal-september.org> |
On 11/22/2015 04:02 PM, Philip Lantz wrote:
> James Kuyper wrote:
>> Philip Lantz wrote:
>>> James Kuyper wrote:
>> ...
>>>> Why not? I thought the original complaint was about the conflict with a
>>>> user-defined identifier with the same name. Users have no right to
>>>> expect a lack of conflict if they use identifiers with file scope that
>>>> start with an underscore. (7.1.3p1).
>>>
>>> Am I not allowed to do this:
>>>
>>> struct s { int _howmany; };
>>>
>>> ?
>>
>> Sorry - the rule is short enough that I should have simply quoted it,
>> rather than summarizing it. My summary left out an important detail
>> relevant to that example:
>>
>> "All identifiers that begin with an underscore are always reserved for
>> use as identifiers with file scope in both the ordinary and tag name
>> spaces."
>>
>> Each structure or union has a separate name space for it's members.
>> (6.2.3p1), so in this case _howmany is in neither the ordinary nor the
>> tag name space.
>>
>> Many people keep things simple by never defining identifiers starting
>> with underscore in any context, even the ones where they're permitted. I
>> recommend following that approach unless and until you have memorized
>> 7.1.3p1, and possibly even then.
>
> Just to be completely clear, you now agree that my example above is
> allowed, right? ...
Yes, it is allowed. I never disagreed with your example.
> ... We use a coding standard (not developed by me), in
> which the names of "private"* members of structures start with _.
> I would be chagrined to discover that that results in undefined
> behavior.
>
> But this is not allowed at file scope:
> struct _s { int x; };
>
> Nor this, at file scope:
> int _s;
Correct.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
howmany -- What the F**k ? James Dow Allen <gmail@jamesdowallen.nospam> - 2015-11-18 12:01 +0000
Re: howmany -- What the F**k ? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-18 07:52 -0500
Re: howmany -- What the F**k ? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-11-18 05:14 -0800
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-18 08:26 -0800
Re: howmany -- What the F**k ? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-18 11:44 -0500
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-18 09:08 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-18 08:31 -0500
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-18 08:25 -0800
Re: howmany -- What the F**k ? James Dow Allen <jdallen2000@yahoo.com> - 2015-11-18 11:58 -0800
Re: howmany -- What the F**k ? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-18 15:14 -0500
Re: howmany -- What the F**k ? James Dow Allen <jdallen2000@yahoo.com> - 2015-11-18 17:48 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-18 21:06 -0500
Re: howmany -- What the F**k ? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-11-19 08:23 -0500
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-19 21:45 -0800
Re: howmany -- What the F**k ? Tim Rentsch <txr@alumni.caltech.edu> - 2015-11-20 12:55 -0800
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-20 03:27 -0800
Re: howmany -- What the F**k ? Philip Lantz <prl@canterey.us> - 2015-11-21 20:40 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-22 10:09 -0500
Re: howmany -- What the F**k ? Philip Lantz <prl@canterey.us> - 2015-11-22 10:18 -0800
Re: howmany -- What the F**k ? gazelle@shell.xmission.com (Kenny McCormack) - 2015-11-22 18:35 +0000
Re: howmany -- What the F**k ? Philip Lantz <prl@canterey.us> - 2015-11-22 13:10 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-22 13:57 -0500
Re: howmany -- What the F**k ? Philip Lantz <prl@canterey.us> - 2015-11-22 13:02 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-22 16:15 -0500
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-23 06:33 -0500
Re: howmany -- What the F**k ? gazelle@shell.xmission.com (Kenny McCormack) - 2015-11-23 12:17 +0000
Re: howmany -- What the F**k ? Philip Lantz <prl@canterey.us> - 2015-11-23 21:09 -0800
Re: howmany -- What the F**k ? Keith Thompson <kst-u@mib.org> - 2015-11-22 12:34 -0800
Re: howmany -- What the F**k ? James Kuyper <jameskuyper@verizon.net> - 2015-11-22 16:18 -0500
csiph-web