← Back to team overview

kicad-developers team mailing list archive

sizeof int and sizeof(size_t) on x86_64

 

> On 64-bit builds, integers are 64 bits so it becomes meaningless at that
> point.  Even on 32 bit hardware, there are much more pressing issues
> that need to be resolved.

Knowing now that int is 32 bit on x86_64 under gcc, we should also know that size_t is 64
bits.

This can be an issue when using


Format( "%d",   stl_container.size() );

In a 32 bit compile, this is no error, but in a x86_64 under gcc, this is a bug, since
size() returns a 64 bit number.

So this is why you will see me adding:

 Format( "%d",   (int) stl_container.size() );

Or you can use the

"%zd"

string.





References