Patch to remove pedantic ANSI warning for long long format when -Wno-long-long is supplied
Bill Priest
bpriest@comspacecorp.com
Mon Feb 22 09:48:00 GMT 1999
All,
I got tired of looking at
"warning: ANSI C does not support the `ll' length modifier"
So I modifed c-common.c to not print this out when -Wno-long-long is used.
Note that the behavior is unchanged if this switch is not present.
Regards,
Bill
PS. From reading the GNU coding standards I understand that copyrights and
legal stuff are not required for this simple kind of change.
Context diff vs. egcs-1.1.2-pre1 follows:
----------------------------------------
*** c-common.c Mon Feb 15 18:40:05 1999
--- /users/bpriest/c-common.c Mon Feb 22 11:36:16 1999
***************
*** 1239,1245 ****
/* Check the argument list of a call to printf, scanf, etc.
INFO points to the function_format_info structure.
PARAMS is the list of argument values. */
!
static void
check_format_info (info, params)
function_format_info *info;
--- 1239,1245 ----
/* Check the argument list of a call to printf, scanf, etc.
INFO points to the function_format_info structure.
PARAMS is the list of argument values. */
! extern int warn_long_long;
static void
check_format_info (info, params)
function_format_info *info;
***************
*** 1561,1567 ****
{
length_char = 'q', format_chars++;
/* FIXME: Is allowed in ISO C 9x. */
! if (pedantic)
warning ("ANSI C does not support the `ll' length modifier");
}
else if (length_char == 'h' && *format_chars == 'h')
--- 1561,1567 ----
{
length_char = 'q', format_chars++;
/* FIXME: Is allowed in ISO C 9x. */
! if (pedantic && warn_long_long)
warning ("ANSI C does not support the `ll' length modifier");
}
else if (length_char == 'h' && *format_chars == 'h')
----------------------------------------
More information about the Gcc-bugs
mailing list