TIP: Click on subject to list as thread! ANSI
echo: binkd
to: Pavel Gulchouck
from: andrew clarke
date: 2021-11-15 16:47:00
subject: Blocking

On 2021-11-14 22:16:48, Pavel Gulchouck (2:463/68) wrote to andrew clarke:

 ac>> -  #define PRIdMAX "I64i"
 ac>> -  #define PRIuMAX "I64u"
 ac>> +  #define PRIdMAX "%I64i"
 ac>> +  #define PRIuMAX "%I64u"

 ac>> Then change the .c files that reference these macros accordingly.

 PG> This way was choosen due to use of the format "%8" PRIuMAX in ftnq.c.
 PG> I'm not sure is it better to create another macro PRIuMAX8 or keep
 PG> existing PRIdMAX without '%'.

My initial reaction was to create a PRIuMAX8. However, inttypes.h in C99 already defines PRIuMAX without the leading %.

And in hindsight I see PRIuMAX is only defined in binkd's sys.h only for pre-C99 versions of MSVC.

So for compatibility with inttypes.h it's best to leave sys.h alone and just hunt for missing % characters in the *.c files (unfortunately).

Normally modern compilers (gcc/clang) are good at flagging printf() format bugs as they're fairly common, so it's strange they are not doing it here, despite building with $(CC) -Wall.

--- GoldED+/BSD 1.1.5-b20180707
                                     
* Origin: Blizzard of Ozz, Melbourne, Victoria, Australia (3:633/267)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.