Re: 0xdeadbeef vs 0xdeadbeefL

From: Ray Lee (ray-lk_at_madrabbit.org)
Date: 07/07/04

  • Next message: Ray Lee: "Re: 0xdeadbeef vs 0xdeadbeefL"
    To: Alexandre Oliva <aoliva@redhat.com>
    Date:	Tue, 06 Jul 2004 23:08:40 -0700
    
    

    On Tue, 2004-07-06 at 22:55, Alexandre Oliva wrote:
    > On Jul 6, 2004, Ray Lee <ray-lk@madrabbit.org> wrote:
    >
    > > Which means 0xdeadbeef is a perfectly valid literal for an unsigned int.
    >
    > Assuming ints are 32-bits wide. They don't have to be.

    In which case the rest of that line that read:
            
            it has the first possible of these types ["in which its value
            can be represented" -- from omitted]: int, unsigned int, long
            int, unsigned long int.

    ...kicks in.

    > or they could be wider than 32 bits, in which case the constant will
    > be signed int instead of unsigned int.

    Read that line again. This would only happen if the platform has no
    unsigned 32 bit integer whatsoever. If you can point out one of those to
    me that Linux runs on, then I'll concede the point. On any other
    platform, the constant oct/hex int promotion rules will walk it up to a
    32-bit unsigned before it hits the larger types.

    Ray

    -
    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: Ray Lee: "Re: 0xdeadbeef vs 0xdeadbeefL"

    Relevant Pages

    • Re: Moving from C++ to VC++
      ... If it is the longest integer. ... platform, I want the longest integer type ... Now /I/ would like to have 'int' being the ... Adhering to what computing standards' intention ...
      (microsoft.public.vc.language)
    • Re: I2C bus implementation (for MPC82xx)
      ... > PowerMac (see the patches that just went in rewriting the PowerMac i2c ... > smbus API, but then, do you really want to use an existing i2c driver? ... For the resources I have used platform definition. ... +static int ...
      (Linux-Kernel)
    • Re: Using OleDBParameter in a simple UPDATE statement
      ... apparently the SQL commands via the .NET OleDb objects w/MySQL are required ... Actually that is specific to the underlying database you are ... Also you might already know this, but an int to one ... > platform might be not an int some other platform. ...
      (microsoft.public.dotnet.framework.adonet)
    • Re: Binary-mode i/o, width of char, endianness
      ... where should fread put this? ... >>into a long int. ... > Consider a platform with 11-bit bytes. ... type 'char' interchangably with 'an int that is one _byte_ big'. ...
      (comp.lang.c)
    • Re: Type of argc
      ... So did removing implicit int, but it improved the language nevertheless. ... Clever programmer #2 has to port the program to platform #2 which has a compiler not up to date. ... And that this C implementation could provide a non-standard way to access all the parameters, such as making argv a NULL-terminated string of pointers to char. ...
      (comp.std.c)