On Thu, Jun 30, 2005 at 11:58:19PM +0200, [email protected] wrote:
> when using sizeof consider using the variable and not the type, that way
> if the type of the variable is changed we don't have to go seaching
> all instances of sizeof(type).
This is a matter of taste, and I decided upon sizeof(type) after a
discussion with Al Viro on this subject.
I believe the overwealming argument for sizeof(type) as opposed to
sizeof(expression) is that you can identify easily where likely
initialisations happen, and therefore places which need to be
properly updated if/when you change the type.
I'm also sending this to Al so he can give his point of view on
sizeof(type) vs sizeof(expression).
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|