Liste des Groupes | Revenir à cl c |
On 13/06/2024 19:01, bart wrote:
And here it just gets even uglier. You also get situations like this:Exactly. We can't have this just to print out an integer.
uint64_t i=0;
printf("%lld\n", i);
This compiles OK with gcc -Wall, on Windows64. But compile under Linux64
and it complains the format should be %ld. Change it to %ld, and it
complains under Windows.
It can't tell you that you should be using one of those ludicrous macros.
I've also just noticed that 'i' is unsigned but the format calls for
signed. That may or may not be deliberate, but the compiler didn't say
anything.
>
In Baby X I provide a function called bbx_malloc(). It's is guaranteed
never to return null. Currently it just calls exit() on allocation failure.
But it also limits allocation to slightly under INT_MAX. Which should be
plenty for a Baby program, and if you want more, you always have big boy's
malloc.
But at a stroke, that gets rid of any need for size_t,
and long is very
special purpose (it holds the 32 bit rgba values).
Les messages affichés proviennent d'usenet.