Is this the only... - Minix

This is a discussion on Is this the only... - Minix ; .... joke in the source code? #define STACK_GUARD ((reg_t) (sizeof(reg_t) == 2 ? 0xBEEF : 0xDEADBEEF))...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Is this the only...

  1. Is this the only...

    .... joke in the source code?

    #define STACK_GUARD ((reg_t) (sizeof(reg_t) == 2 ? 0xBEEF : 0xDEADBEEF))




  2. Re: Is this the only...

    Bernhard Kast writes:

    > ... joke in the source code?
    >
    > #define STACK_GUARD ((reg_t) (sizeof(reg_t) == 2 ? 0xBEEF : 0xDEADBEEF))
    >
    >


    You might enjoy
    http://www.decafbad.com/twiki/bin/view/Main/HexOddities
    as well.

    Notice that 0xDEADBEEF is an uneven address, and as such will cause a
    fault on machines that expect memory access to be evenly aligned on
    16/32/64 bit words.

    --
    Thomas Bjorn Andersen
    +++ATH

  3. Re: Is this the only...

    It's actually a fairly common thing to do. I remember seeing 0xDEADBEEF
    used, for instance, in an embedded system. The reason is that values
    like 0xDEADBEEF are easy to recognize when you are using a debugger or
    looking at a core file. It just doesn't look random enough to go
    unnoticed.

    Also, there's a joke in clock_time().


+ Reply to Thread