This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Darwin vs. libstdc++



On Tuesday, October 9, 2001, at 11:17 AM, Neil Booth wrote:

> Stan Shebs wrote:-
>
>> Really?  I don't see anything in my C89 or C99 specs that suggests
>> that isalnum and friends don't need function definitions.  For one
>> thing, you can't take the address of a macro, so the standard would
>> have to say explicitly that the address of isalnum is undefined.
>
> You could have both.  Anything with a following '(' uses the macro.
> Taking the address of the function will not have a following '(', and
> so would not be treated by CPP as a macro invocation.

Yes.  A function is required to exist (explicitly, in c89,
I don't have the other specs handy); an additional macro implementation
is permissible, but not required.  The functions are there in the Darwin
library; it is a known bug in <ctype.h> that some declarations are missing.
Here is a complete list:  isalnum, isalpha, iscntrl, isdigit, isgraph,
islower, isprint, ispunct, isspace, isupper, isxdigit.  Anyone so
inclined can hack around the problem by adding declarations for these to
<ctype.h> (before the existing macro definitions).  Sorry, none of the
Apple people who post to this list has any control over when (or whether)
this gets fixed in releases.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]