asctime.c

Andrew Brown atatat at atatdot.net
Thu Aug 5 06:13:25 UTC 2004


On Wed, Aug 04, 2004 at 06:10:11PM +0100, Clive D.W. Feather wrote:
>This can be tested at compile time: add to "struct dummy" a number of
>fields of the form:
>
>    int assert_size_spec_big_enough_for_char
>        [MAX_INTEGRAL_TYPE_SIZE + 1 - sizeof (char)];
>    int assert_size_spec_big_enough_for_short
>        [MAX_INTEGRAL_TYPE_SIZE + 1 - sizeof (short)];
>    int assert_size_spec_big_enough_for_int
>        [MAX_INTEGRAL_TYPE_SIZE + 1 - sizeof (int)];

if you're going to do that, at least make it

    typedef int assert_size_spec_big_enough_for_char
        [MAX_INTEGRAL_TYPE_SIZE + 1 - sizeof (char)];
    typedef int assert_size_spec_big_enough_for_short
        [MAX_INTEGRAL_TYPE_SIZE + 1 - sizeof (short)];
    typedef int assert_size_spec_big_enough_for_int
        [MAX_INTEGRAL_TYPE_SIZE + 1 - sizeof (int)];

so that the compiler can barf if it wants to, but there's no impact on
the generated code.

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



More information about the tz mailing list