Subject: Re: disk block number printing
To: David Laight <david@l8s.co.uk>
From: Andrew Brown <atatat@atatdot.net>
List: tech-kern
Date: 04/13/2003 12:31:36
>> #if sizeof(daddr_t) > sizeof(int) (or uint32_t, or whatever the "small"
>> daddr_t version actually uses)?
>
>Nope - you can't use sizeof() in a preprocessor expression

that's because sizeof() is a c operator (like % and [] and -> and the
unary & and *, etc), not a pre-processor function (like defined()) .

>(I did check because gcc could manage to do it, but it would tend
>to break the parsing rules.  Traditional C (with a separate cpp)
>can't possibly support it.)

i'm sure you could make gcc's preprocessor do it, but i'd be wary of
having two pieces of code doing the same work, with the distinct
possibility one would get out sync with the other, or just get it
wrong.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."