Re: 0xdeadbeef vs 0xdeadbeefL

viro_at_parcelfarce.linux.theplanet.co.uk
Date: 07/07/04

  • Next message: Peter Williams: "Re: [PATCH] CPU scheduler evaluation tool"
    Date:	Wed, 7 Jul 2004 15:22:10 +0100
    To: tom st denis <tomstdenis@yahoo.com>
    
    

    On Wed, Jul 07, 2004 at 04:10:28AM -0700, tom st denis wrote:
    > > Pay attention to difference in the set of acceptable types for
    > > decimal
    > > and heaxdecimal constants.
    >
    > You're f'ing kidding me right? Dude, I write portable ISO C source
    > code for a living. My code has been built on dozens and dozens of
    > platforms **WITHOUT** changes. I know what I'm talking about.
    >
    > 0x01, 1 are 01 all **int** constants.

    Correct. And irrelevant.

    > On some platforms 0xdeadbeef may be a valid int

    Correct, but incomplete.

    > Before you step down to belittle others I'd suggest you actually make
    > sure you're right.

    Always do.

    Exercise:
            1) what type does an integer constant 0xdeadbeef have on a platform
    with INT_MAX equal to 0x7fffffff and UINT_MAX equal to 0xffffffff?
            2) when does the situation differ for integer constant 3735928559?

    Oh, and do read the part of C standard in question. Hint: extra restrictions
    are placed on decimal constants, not on the octals and hexadecimals.
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Peter Williams: "Re: [PATCH] CPU scheduler evaluation tool"