Subject: Re: Bluetooth protocol code
To: None <firstname.lastname@example.org>
From: Valeriy E. Ushakov <email@example.com>
Date: 12/20/2005 10:00:13
On Tue, Dec 20, 2005 at 09:38:58 +0300, Valeriy E. Ushakov wrote:
> The issue can arise with short integral types that are passed "as-is"
> for ANSI, and that are subject to widening conversion for K&R. To hit
> this bug, you also need to be on a platform, that passes e.g. shorts
> and ints diffrently, i.e. it should pass them via stack, and should
> not perform the widening *always* (as e.g. i386 does).
Actually, since we mandate prototypes, this should not happen either.
The issue would arise if the k&r definition was compiled w/out the
ANSI prototype, so the the function body would assume widening, and
callers (that only saw ANSI prototype) would assume no widening.
Anyway, by always using ANSI style you can just totally ignore all
those issues form 10+ years ago. ;)
On the readability side however, I encoutered few issues in our kernel
code like e.g:
foo(bar, dfg, fwd, ffg, nitems, nsize, alignment)
Substitute longer variable and type names to make the problem even
firstname.lastname@example.org | Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/ | Ist zu Grunde gehen