Commit 30145215 by Kaveh R. Ghazi Committed by Kaveh Ghazi

c-common.c (check_format_info): Avoid non-literal format string warnings when…

c-common.c (check_format_info): Avoid non-literal format string warnings when `first_arg_num' is zero.

       * c-common.c (check_format_info): Avoid non-literal format string
       warnings when `first_arg_num' is zero.

From-SVN: r30240
parent 4404ce28
Thu Oct 28 06:47:32 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* c-common.c (check_format_info): Avoid non-literal format string
warnings when `first_arg_num' is zero.
Thu Oct 28 12:28:48 1999 Bernd Schmidt <bernds@cygnus.co.uk> Thu Oct 28 12:28:48 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* rtl.texi: Delete explicit Prev, Up and Next entries in "@node"s. * rtl.texi: Delete explicit Prev, Up and Next entries in "@node"s.
......
...@@ -1491,6 +1491,10 @@ check_format_info (info, params) ...@@ -1491,6 +1491,10 @@ check_format_info (info, params)
{ {
/* The user may get multiple warnings if the supplied argument /* The user may get multiple warnings if the supplied argument
isn't even a string pointer. */ isn't even a string pointer. */
/* Functions taking a va_list normally pass a non-literal format
string. These functions typically are declared with
first_arg_num == 0, so avoid warning in those cases. */
if (info->first_arg_num != 0)
warning ("format not a string literal, argument types not checked"); warning ("format not a string literal, argument types not checked");
return; return;
} }
...@@ -1499,6 +1503,10 @@ check_format_info (info, params) ...@@ -1499,6 +1503,10 @@ check_format_info (info, params)
{ {
/* The user may get multiple warnings if the supplied argument /* The user may get multiple warnings if the supplied argument
isn't even a string pointer. */ isn't even a string pointer. */
/* Functions taking a va_list normally pass a non-literal format
string. These functions typically are declared with
first_arg_num == 0, so avoid warning in those cases. */
if (info->first_arg_num != 0)
warning ("format not a string literal, argument types not checked"); warning ("format not a string literal, argument types not checked");
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment