Subject: Re: disk block number printing
To: David Laight <>
From: Andrew Brown <>
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

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."