Re: isascii???

From: tom_usenet (tom_usenet_at_hotmail.com)
Date: 08/16/04


Date: Mon, 16 Aug 2004 11:45:17 +0100

On Sat, 14 Aug 2004 09:30:40 -0600, Jerry Coffin <jcoffin@taeus.us>
wrote:

>In article <ejxtoWHgEHA.2916@TK2MSFTNGP12.phx.gbl>,
>m.holmes@nospam.it says...
>
>[ ... ]
>
>> is 'isascii' a reserved word?
>
>Section 7.26.2 of the C standard reserves all external names that
>start with 'is' followed by any lower-case letter. Section 7.1.4
>gives permission for functions defined in the headers to be
>additionally defined as macros.

The C++ standard doesn't seem to reserve "is*" words (looking in the
reserved names section). I also can't see anything allowing standard
functions to be macros, and indeed, some c library headers use inline
functions rather than macros if __cplusplus is defined.

>> I guess 'isascii' is a macro defined in cctype, but since the following
>> sample does not compile in VC71, and this is somehow unexpected, might it be
>> a bug?
>
>IMO, it's open to some question and interpretation, to the point that
>it's clearly a bad idea at best.
>
>The question and interpretation come in from the wording in the
>standard -- section 7.26 is titled "Future Library Directions", which
>seems to indicate that its limitations are meant to describe things
>that might be added to the library sometime in the future. OTOH, if
>you read 7.26.2 by itself, it simply says that names for external
>identifiers that start with 'is' followed by a lower-case letter may
>be added to the ctype.h (and, therefore, cctype) header. Section
>7.1.4 says that if the implementation does provide a global function
>by that name, it can also provide a macro by the same name.
>
>IOW, I think it's more by accident than design, but I'd say this is a
>conforming extension.

But we're talking about C++, not C, and I don't think it's a
conforming extension in C++, or is it?

Tom



Relevant Pages

  • Re: Programming in standard c
    ... is it non-standard? ... decided for some bizarre reason to avoid using the macros. ... without access to the headers and it was easiest to plug in these constants. ... My assumption is the file is in binary mode; and my wrapper of the fopen ...
    (comp.lang.c)
  • Re: 128 bit integers
    ... bit machines around when we wrote it". ... appropriate macros would be adequate. ... namespace in those headers. ...
    (comp.std.c)
  • Re: typical practise for #includes
    ... > I wonder are there any typical, common used practises to organize all ... > and also some macros, variables, types. ... > some of these headers might be useless in other translation units, ... Depends if your compiler supports this method or not. ...
    (comp.lang.c)
  • Headers in toc pages not uniform with the rest of document
    ... I am using book class of LaTeX and have macros to typeset chapter ... titles and headers a certain way. ... All my headers are being typeset as I ...
    (comp.text.tex)