lkml.org 
[lkml]   [2012]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [00/02] add BUILD_BUG_DECL assertion (for 3.4??)
    From
    Date
    On Mon, 2012-04-09 at 13:52 -0600, Jim Cromie wrote:
    > On Sun, Apr 8, 2012 at 8:37 PM, Joe Perches <joe@perches.com> wrote:
    > > Discontiguous array definitions must be ugly.
    > Ugly ?
    > too pejorative IMO

    Ugly code is not a pejorative, it's more an
    artifact of creation and always a beholder
    issue.

    > each array defn is a single statement.

    I thought you meant the array entries not
    the arrays themselves.

    > there may be functions between the 2 defns being compared.
    >
    > Maybe not ideal,
    >
    > >
    > >> Do you see advantages other than stylistic ones ?
    > >
    > > Not really.
    > >
    > > Contiguous declarations.
    > > No need for other markings.
    > >
    > > Seems useful enough.
    > >
    >
    > OK. Id expect your construct to be built upon mine,
    > we'd still need to start with something.
    >
    > Also, mine is usable for things yours isnt.
    > I dont have a good example, but a simple/silly one is:
    >
    > BUILD_BUG_DECL( wifi_channels_must_be_14,
    > ARRAY_SIZE(channels_table) == 14 );

    Do what you think best.

    I think it's a solution for a relatively
    minor problem.

    The BUILD_BUG_DECL marking might be improved.
    BUILD_BUG_DECL might be a bit short or not
    descriptive enough.

    Maybe BUILD_BUG_DIFF_SIZE or BUILD_BUG_SIZE_NE?




    \
     
     \ /
      Last update: 2012-04-09 22:11    [W:0.024 / U:0.748 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site