This page describes some issues that are still open. If you have ideas for a solution (or even general comments) feel free to add to the discussion.

64-bit safe format strings

In order to compile on AMD64, I've had to fix a few gcc warnings, with regards to format strings.

The problem arises when we use a fixed-size integer. Consider the code:

uint64_t x = 0;
printf("%ld", x);

This will be valid on a 64-bit machine, where a %ld is a 64-bit quantity. However, it will not compile on a 32-bit platform (as a long is only 32 bits). In that case, we'd need something like:

uint64_t x = 0;
printf("%lld", x);

but now we just have the reverse problem.

The "standard" fix for this is the POSIX format-string macros, such as PRId64 (printf string, %d-style, 64 bits), which will expand to whatever format string is suitable for a 64-bit quantity. However, as Brian has suggested, this is a little ugly. For example:

    printf("Warning: %" PRIu64 " bytes lost from CPU %d\n", lost, cpu);

Any ideas?

Dependencies on build

The reason the module loader patch isn't commited yet is that it breaks parallel builds (ie, without SEQ=1). For some reason, it looks like the boot_image.map (the symbol table used by the module loader) is generated from the boot_image.dbg when it is only half-created.

Does anyone with experience with K42's make system know how to resolve this?

OpenProblems (last edited 2005-04-26 06:41:49 by JeremyKerr)