lkml.org 
[lkml]   [1999]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Mixing egcs and gcc-2.7.2.3 compiled code: struct alignment issues?
    On Tue, 20 Jul 1999, Steve Dodd wrote:

    > Does this mean that the compilers are padding struct inode *differently*,
    > resulting in u.generic_ip being at different offsets? That's a nightmare :(

    I've been bitten by this before. The linux kernel source is at
    fault, classic example is in include/asm-i386/spinlock.h

    #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
    typedef struct { } rwlock_t;
    #define RW_LOCK_UNLOCKED (rwlock_t) { }
    #else
    typedef struct { int gcc_is_buggy; } rwlock_t;
    #define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
    #endif

    Any structure incorporating these lock types will thus be differing sizes
    depending on your version of gcc. grep the source carefully for "GNUC"


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:53    [W:0.018 / U:65.832 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site