supressing specific warnings

bridged with qnx.development_tools
Post Reply
Bill Caroselli

supressing specific warnings

Post by Bill Caroselli » Wed Jul 14, 2004 5:41 pm

I am using the new GCC compiler 3.3.1.

It is flagging things as warning that it has never flagged before.
THIS IS GOOD! I like the compiler to help me with warnings.

But, . . . . I can't seem to code away one warning in particular. So,
I need to supress it. Our code must compile without warnings. The
warning is:
callbacks.cc:188: warning: `%D' yields only last 2 digits of year
on the lines:
static const char timeFormatString [] = "%a %b %D, %T";
strftime( buffer, 32, timeFormatString, localtime( &prev_TOD ) );

I only want the last 2 digits. How do I make this warning go away?

John Murphy

Re: supressing specific warnings

Post by John Murphy » Wed Jul 14, 2004 8:38 pm

Try " -Wno-format-y2k".

Murf

Bill Caroselli wrote:
I am using the new GCC compiler 3.3.1.

It is flagging things as warning that it has never flagged before.
THIS IS GOOD! I like the compiler to help me with warnings.

But, . . . . I can't seem to code away one warning in particular. So,
I need to supress it. Our code must compile without warnings. The
warning is:
callbacks.cc:188: warning: `%D' yields only last 2 digits of year
on the lines:
static const char timeFormatString [] = "%a %b %D, %T";
strftime( buffer, 32, timeFormatString, localtime( &prev_TOD ) );

I only want the last 2 digits. How do I make this warning go away?

Post Reply

Return to “qnx.development_tools”