UFO:Alien Invasion

Development => Coding => Topic started by: noob on October 28, 2011, 10:55:13 pm

Title: codeblocks compile warnings
Post by: noob on October 28, 2011, 10:55:13 pm
Quote
||=== ufo, windows ===|
C:\Games\UFOAI\src\client\battlescape\..\renderer\r_image.h|111|warning: 'libintl_printf' is an unrecognized format function type|
C:\Games\UFOAI\src\client\battlescape\..\cgame\cgame.h|91|warning: 'libintl_printf' is an unrecognized format function type|
C:\Games\UFOAI\src\client\battlescape\..\cgame\cgame.h|152|warning: 'libintl_printf' is an unrecognized format function type|
C:\Games\UFOAI\src\client\battlescape\..\cgame\cgame.h|153|warning: 'libintl_printf' is an unrecognized format function type|
C:\Games\UFOAI\src\client\battlescape\..\cgame\cgame.h|188|warning: 'libintl_printf' is an unrecognized format function type|
C:\Games\UFOAI\src\client\battlescape\..\cgame\cgame.h|213|warning: 'libintl_printf' is an unrecognized format function type|
C:\Games\UFOAI\src\client\battlescape\..\cgame\cgame.h|217|warning: 'libintl_printf' is an unrecognized format function type|
C:\Games\UFOAI\src\client\battlescape\..\cgame\cgame.h|218|warning: 'libintl_printf' is an unrecognized format function type|
C:\Games\UFOAI\src\client\battlescape\..\cgame\cgame.h|219|warning: 'libintl_printf' is an unrecognized format function type|
etc
its ok or something wrong with codeblocks 10.05?

Title: Re: codeblocks compile warnings
Post by: AndyZCS on October 21, 2012, 05:29:46 pm

In various header files used by UFO & UFO_TESTALL there are uses of
'__attribute__((format(printf' to enable the compiler to perform additional checks.
Changing this to '__attribute__((format(__printf__' stops the preprocessor from causing the warning in the C::B environment.

Ref: http://docs.freebsd.org/info/gcc/gcc.info.Function_Attributes.html

"   You may also specify attributes with `__' preceding and following
each keyword.  This allows you to use them in header files without
being concerned about a possible macro of the same name.  For example,
you may use `__noreturn__' instead of `noreturn'."

I have had this working on my local copy for a few months & haven't seen any side effects in C::B

Regards
   Andy

Title: Re: codeblocks compile warnings
Post by: Mattn on October 21, 2012, 09:01:55 pm
thanks a lot Andy - this is applied to master now