Messages in this thread | | | Subject | Re: [00/02] add BUILD_BUG_DECL assertion (for 3.4??) | From | Joe Perches <> | Date | Mon, 09 Apr 2012 13:08:03 -0700 |
| |
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?
| |