[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1334002083.3228.15.camel@joe2Laptop>
Date: Mon, 09 Apr 2012 13:08:03 -0700
From: Joe Perches <joe@...ches.com>
To: Jim Cromie <jim.cromie@...il.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [00/02] add BUILD_BUG_DECL assertion (for 3.4??)
On Mon, 2012-04-09 at 13:52 -0600, Jim Cromie wrote:
> On Sun, Apr 8, 2012 at 8:37 PM, Joe Perches <joe@...ches.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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists