Be less ugly when hiding warnings for using the %B formatter
- Take advantage of the new _Pragma operator to hide the printf warning suppression inside of macros instead of needing to litter the code around Printfs with a bunch of junk.
This commit is contained in:
parent
bce7d12379
commit
f76d137d33
3 changed files with 22 additions and 15 deletions
|
|
@ -7496,22 +7496,9 @@ scriptwait:
|
|||
break;
|
||||
|
||||
case PCD_PRINTBINARY:
|
||||
#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6)))) || defined(__clang__)
|
||||
#define HAS_DIAGNOSTIC_PRAGMA
|
||||
#endif
|
||||
#ifdef HAS_DIAGNOSTIC_PRAGMA
|
||||
#pragma GCC diagnostic push
|
||||
#ifdef __clang__
|
||||
#pragma GCC diagnostic ignored "-Wformat-invalid-specifier"
|
||||
#else
|
||||
#pragma GCC diagnostic ignored "-Wformat="
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Wformat-extra-args"
|
||||
#endif
|
||||
IGNORE_FORMAT_PRE
|
||||
work.AppendFormat ("%B", STACK(1));
|
||||
#ifdef HAS_DIAGNOSTIC_PRAGMA
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
IGNORE_FORMAT_POST
|
||||
--sp;
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue