Pavel Roskin escribió:
On Tue, 2009-07-21 at 23:45 +0200, Vladimir 'phcoder' Serbinenko wrote:

This change would allow to produce a code which is cleaner, easier to
read and understand. However I'm opposed to modifying printf function
for it.

I think Javier misspoke or didn't realize that *printf doesn't need to
be modified.
Indeed, I didn't realise so. All that's required is a grub_inttypes header that either takes from the system stdint.h types or just defines the macros you were discussing.

 Instead we could just define somewhere:
GRUB_PRIx32 "%x"

Better yet, "x", as in libc.  That would allow for "%08x" that we need
for UUID.
Yeah, that is the format used in libc. I copied the example wrong, without the "%08"s.

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.



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to