Re: array subscript type cannot be `char`?
Jordan Abel schrieb:[color=blue]
> On 2006-03-27, Michael Mair <Michael.Mair@i nvalid.invalid> wrote:
>[color=green]
>>Jordan Abel schrieb:
>>[color=darkred]
>>>Note: No context quoted because I'm replying to the actual issue the
>>>thread brings up rather than to any particular post
>>>
>>>What all this is missing is that it's silly to warn on an array
>>>subscript of type char when you don't warn on one of type signed int.
>>>
>>>Idea -- magic safe macro for isalpha:
>>>
>>>#define ISALPHA(x) isalpha(sizeof( x)==1?(unsigned char)(x):(x))[/color]
>>
>>Hmmm. Nice until x is something with sideeffects like, say,
>>"c = getchar()".[/color]
>
> That's why it's uppercase. To warn you.[/color]
For functionality as basic as this, I do not trust anyone
to use it consistently correctly -- including me. I remember
a then-colleague abusing a macro with the words "Oh, it's
from XY -- he surely did something clever"... ;-(
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Jordan Abel schrieb:[color=blue]
> On 2006-03-27, Michael Mair <Michael.Mair@i nvalid.invalid> wrote:
>[color=green]
>>Jordan Abel schrieb:
>>[color=darkred]
>>>Note: No context quoted because I'm replying to the actual issue the
>>>thread brings up rather than to any particular post
>>>
>>>What all this is missing is that it's silly to warn on an array
>>>subscript of type char when you don't warn on one of type signed int.
>>>
>>>Idea -- magic safe macro for isalpha:
>>>
>>>#define ISALPHA(x) isalpha(sizeof( x)==1?(unsigned char)(x):(x))[/color]
>>
>>Hmmm. Nice until x is something with sideeffects like, say,
>>"c = getchar()".[/color]
>
> That's why it's uppercase. To warn you.[/color]
For functionality as basic as this, I do not trust anyone
to use it consistently correctly -- including me. I remember
a then-colleague abusing a macro with the words "Oh, it's
from XY -- he surely did something clever"... ;-(
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Comment