grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] UUID support for UFS


From: Javier Martín
Subject: Re: [PATCH] UUID support for UFS
Date: Tue, 21 Jul 2009 23:34:42 +0200
User-agent: Thunderbird 2.0.0.22 (Windows/20090605)

Pavel Roskin escribió:
On Tue, 2009-07-21 at 22:14 +0200, Javier Martín wrote:

But I would prefer that we work on fixing bugs rather than non-bugs.

"Fixing" this would allow us to have cleaner code, and separate "casual variables" from fixed-length variables. If we print int with %d and int32_t with PRId32, the impact of the subtle bugs that appear when we port across architectures will be reduced.

If int and int32_t are different types, gcc will warn about it, at least
for implicit conversion with data loss.
Oh, yes... with the current build system and without -Werror, warnings are _very_ visible. </sarcasm> Besides, do we really have -Wconversion enabled? I don't know, but gcc tends to be quite silent when it comes to type conversion, mainly due to the laxitude it's used in *nix C programs. The cast in that code was all but implicit, and explicit casts tend to shut the compiler up.


It's more likely that bugs will be introduced by that change, not fixed.
Besides, the code will be harder to read.
You say it'd be harder to read because the macros are newly-introduced (C99) and thus not widely know. However, they are pretty clear and self-explanatory once you google them the first time... and at the very least they call attention to themselves: an unknowing programmer would wonder what they are. Using a "normal" print specifier and a type cast does not.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]