NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: John Chamberlain on September 07, 2012, 11:38:51 PM
-
Hi there seems to be a type conversion issue in disasm.c at several points. For example, there is the code:
if (autosync) add_sync(offs, 0L);
at line 1275, where add_sync is defined as:
void add_sync(uint32_t pos, uint32_t length)
and "offs" is defined as:
int64_t offs;
Obviously this is going to generate a warning. Any opinions about the right way to eliminate this warning?
-
Hi John,
Sorry for the delayed reply. I suspect the "right" way to fix it is to make everything 64-bit. Probably(?) safe(?) to ignore?
Thanks for the feedback!
Best,
Frank
-
I would say the "proper" way would be to use the greatest width variants in stdint.h
void add_sync(uintmax_t pos, uintmax_t length)
and
intmax_t offs;
These types represent the largest possible [un]signed integer types for our target platform respectively and would provide the greatest level of portability.