Re: [C++] ceil() outside <cmath>

From: B. v Ingen Schenau (bart_at_ingen.ddns.info)
Date: 04/04/04


Date: Sun, 04 Apr 2004 22:19:09 +0200

Robert W Hand wrote:

> On Sun, 04 Apr 2004 11:21:44 +0200, "B. v Ingen Schenau"
> <bart@ingen.ddns.info> wrote:
>
>>There is more explicit language to that extent in subclause 7.1.3, bullets
>>3 and 5.
>>The standard states there that macros and file-scope identifiers, that are
>>defined in the standard, are only reserved if an associated header is
>>included.
>>
>>That makes that this program is strictly conforming in C:
>>
>>#include <stdio.h>
>>int main()
>>{
>> int strlen = 42;
>>
>> printf("%d", strlen);
>> return 0;
>>}
>
> I don't think so. Check out 7.26.
>
> "The following names are grouped under individual headers for
> convenience. All external names described below are reserved no matter
> what headers are included by the program."
>
> "7.26.11 String handling <string.h>
>
> 1 Function names that begin with str, mem, or wcs and a lowercase
> letter may be added to the declarations in the <string.h> header."
>
> So strlen is not an allowable identifier.

If subclause 7.26p1, which uses quite broad wording, is overriding over
subclause 7.1.3, which is quite specific about the conditions under which
names are reserved, then why did they not just state that the names
specified in the standard are reserved under all conditions?
And in addition, if subclause 7.26 overrides 7.1.3, you can't use names like
'is_valid', 'member' or 'total' either, because they are also reserved
subclause 7.26.

Bart v Ingen Schenau

-- 
a.c.l.l.c-c++ FAQ: http://ma.rtij.nl/acllc-c++.FAQ.html
c.l.c FAQ: http://www.eskimo.com/~scs/C-faq/top.html
c.l.c++ FAQ: http://www.parashift.com/c++-faq-lite/


Relevant Pages

  • Re: Unions Redux
    ... Standard, there is no supporting text in the Standard proper. ... A valid object representation of a signed integer ... I took "subclause" to mean 6.2.6.1 ... It spelled out the concept of a bit-preserving cast, ...
    (comp.lang.c)
  • Re: [C++] ceil() outside <cmath>
    ... For example, the General Utilities subclause ... >>statement AFAIK in the C Standard. ... The header declares a set of related ... a.c.l.l.c-c++ FAQ: http://ma.rtij.nl/acllc-c++.FAQ.html ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Section from the C standard.
    ... >to ISO C subclause 5.2.4.2.1. ... >I don't have access to the C standard presently, could someone please quote the ... >relevant clause for me. ...
    (comp.lang.c)
  • Re: Section from the C standard.
    ... > to ISO C subclause 5.2.4.2.1. ... The last public draft of the Standard can be downloaded here: ...
    (comp.lang.c)
  • Re: novice: small annoyance
    ... Alwyn wrote: ... The code you posted from the latest draft of the standard is also ... there is a more general defect report about the issue of which headers ... a.c.l.l.c-c++ FAQ: http://www.comeaucomputing.com/learn/faq ...
    (alt.comp.lang.learn.c-cpp)