[LinuxBIOS] r413 - in LinuxBIOSv3: arch/x86 include mainboard/artecgroup/dbe61 southbridge/amd/cs5536 superio/winbond/w83627hf

Uwe Hermann uwe at hermann-uwe.de
Tue Jul 3 01:41:00 CEST 2007

On Sun, Jul 01, 2007 at 12:11:38AM +0200, Peter Stuge wrote:
> On Fri, Jun 29, 2007 at 04:36:03PM +0200, svn at openbios.org wrote:
> > +#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
> Need extra () around a or no?
> sizeof((a)) / sizeof(((a))[0])) ?

Hm, good question. I guess not, I've seen many projects use this macro
without that many braces, but maybe they're all wrong ;-)

As long as 'a' is a simple array all should be fine, I guess. Using
ARRAY_SIZE on something other than an array is probably a bug anyway.

http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20070703/5f3aa7a8/attachment.sig>

More information about the coreboot mailing list