[lkml]   [2002]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Important per-cpu fix.
       From: Rusty Russell <>
    Date: Mon, 09 Sep 2002 13:45:02 +1000

    /* FIXME: Initializer required so gcc 2.96 doesn't put in BSS */
    DEFINE_PER_CPU(int, xxx) = 0;

    everywhere, which can be deleted later

    Why everywhere? If you do it in the macro, then when you want
    to delete the initializer remove the macro arg. Then you cover
    both in-kernel and cases in external sources because the build
    will break for them so they'll know to fixup their macro invocation.

    I hate when things change silently, and if you don't put it in
    the macro, someone will get it wrong and we'll find out only
    when someone with an older compiler uses that feature on an SMP

    Read as: This is bad programming practice Rusty, regardless of
    your personal views about this particular GCC bug or
    what you think is a legitimate initializer.

    See spinlock_t's declaration for older GCC versions, that is how we
    traditionally deal with compiler bugs like this, explicitly so that it
    is impossible to "miss" something and get it wrong.

    Everytime I asked Linus to rearrange some piece of code that used
    spinlock_t initializers to workaround the "empty initializer at
    end of struct" GCC bug he always told me "someone will get it
    wrong if we do it that way" And I think he's right.
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

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