lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Am 02.06.2011 20:47, schrieb Marc Balmer:
Am 02.06.2011 19:44, schrieb liam mail:

On 2 June 2011 18:09, Tony Finch < <>>

Marc Balmer < <>> wrote:
> What does the standard say is*() should return if the argument is
> Is that specified at all?

It seems to be unspecified. This is probably a bug in the standard.
Here's a link to C99 with all the technical corrigenda included. The
relevant part is section 7.4 starting on page 181.

f.anthony.n.finch < <>>
Rockall, Malin, Hebrides: South 5 to 7, occasionally gale 8 at first in
Rockall and Malin, veering west or northwest 4 or 5, then backing
southwest 5
or 6 later. Rough or very rough. Occasional rain. Moderate or good,
occasionally poor.

Although the C99 standard does not state it, the C99 rationale v5.1[1]
"*7.4.1Character classification functions *
**The definitions of /printing character /and /control character /have
been generalized from ASCII.
Note that none of these functions returns a nonzero value (true) for the
argument value *EOF*."

So if Microsoft claims to be in support of the C99 standard, this is
clearly a bug in their implementation of the SDK. And since they don't
have a friendly mailing list and community like Lua does, I am fucked.

Seems like I have to take is*() from another system, just to be sure...


for general amusement, this is how to make a microsoft compiler halfway standards compliant:

#undef isalnum
#define isalnum(_c)      ( _c == EOF ? 0 : _isctype(_c,_ALPHA|_DIGIT) )
#undef isdigit
#define isdigit(_c)      ( _c == EOF ? 0 : _isctype(_c,_DIGIT) )