[Bf-committers] Re: new round of warning hunt : some goofy things i cant decide on

Vio vmilitaru at sympatico.ca
Sun Jun 5 10:47:32 CEST 2005


GSR wrote:

>Hi,
>vmilitaru at sympatico.ca (2005-06-04 at 1817.41 -0400):
>  
>
>>>>>Functions like sizeof() and strlen() return size_t or similar.
>>>>>This is unsigned because the size of something is >= zero
>>>>>          
>>>>>
>>>>just a little nitpick here: sizeof is a internal compiler keyward.  
>>>>it's not a function.
>>>>        
>>>>
>>>Just a little nitpick here too: it's not "keyward", it's "keyword" ;-)
>>>      
>>>
>>I'm not 100% positive on this, but I think sizeof() is a function, not a 
>>keyword. I just wrote
>>a C scanner/parser not long ago to eat at blender sources, and I don't 
>>recall using sizeof()
>>as a token. On the other hand, I am no bison or C guru by a longshot.
>>    
>>
>
>K&R ANSI C says it is a reserved keyword in A2.4, an unary operator in
>A7.4 and described in depth in A7.4.8. I hope that book is right or I
>want my money back. :]
>  
>
Oops, should have actually checked my scanner code, instead of relying 
on fledging memory.
There is indeed a 'sizeof' token. I bow in shame. Laziness not good. 
Don't throw that book away
just yet.
vio



More information about the Bf-committers mailing list