[coldfire-gnu-discuss] 4.3-43 toolchain for mcf547x warnings

Wong, Ken Ken.Wong at christiedigital.com
Thu May 28 14:14:16 UTC 2009


Maxim/Mark: thanks for all the info... I gave the -Wformat flag a try in our build system and didn't see the warning when compiling but everything that the both of you told me gives me enough to work with to look into it further.

I'll send an update when I figure out what I'm doing wrong. :)

Ken Wong
Product Developer, Software, Business Products
CHRISTIE
809 Wellington Street North
Kitchener, Ontario N2G 4Y7
PH: +1 519-744-8005 Ext. 7177
FX: +1 519-749-3164
www.christiedigital.com

This e-mail message (including attachments, if any) is confidential.
Any unauthorized use, distribution or disclosure is prohibited.
If you have received this e-mail message in error, please notify 
the sender by reply e-mail or telephone and delete it and any 
attachments from your computer system and records.


-----Original Message-----
From: Mark Mitchell [mailto:mark at codesourcery.com] 
Sent: Thursday, May 28, 2009 4:06 AM
To: Wong, Ken
Cc: coldfire-gnu-discuss at codesourcery.com
Subject: Re: [coldfire-gnu-discuss] 4.3-43 toolchain for mcf547x warnings

Wong, Ken wrote:

> Using the 4.3-43 toolchain, I’m not getting the “too many arguments”
> warning when I compile the following sample code:

> static const char test[] = "%d";

>   printf (test, a, b);

GCC, unlike most compilers, issues different warnings depending on what
optimizations are performed.  If the compiler notices that the array is
"const", and therefore substitutes the string into the "printf" call,
then it will issue the warning.  But, if it doesn't, then it will not.
Whether that substitution occurs depends on the exact version of the
compiler and what level of optimization is in use.

Some users find this variability of warnings confusing.  (I do,
personally.)  But, some people like the fact that the compiler can then
offer warnings about cases like yours; many other compilers cannot issue
such warnings because they do not do any optimization before issuing
warnings.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark at codesourcery.com
(650) 331-3385 x713


More information about the coldfire-gnu-discuss mailing list