Commit 36611067 by Kaveh R. Ghazi Committed by Kaveh Ghazi

cccp.c (pedwarn_with_file_and_line): For !__STDC__ case...

        * cccp.c (pedwarn_with_file_and_line): For !__STDC__ case, avoid
        accessing variables until they are initialized via va_arg().

From-SVN: r22585
parent 8d62cb85
Fri Sep 25 10:43:47 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cccp.c (pedwarn_with_file_and_line): For !__STDC__ case, avoid
accessing variables until they are initialized via va_arg().
Thu Sep 24 22:12:16 1998 David S. Miller <davem@pierdol.cobaltmicro.com> Thu Sep 24 22:12:16 1998 David S. Miller <davem@pierdol.cobaltmicro.com>
* reload1.c (reload_combine): Initialize set before using. * reload1.c (reload_combine): Initialize set before using.
......
...@@ -9568,14 +9568,7 @@ pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line, ...@@ -9568,14 +9568,7 @@ pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line,
if (!pedantic_errors && inhibit_warnings) if (!pedantic_errors && inhibit_warnings)
return; return;
if (file) {
eprint_string (file, file_len);
fprintf (stderr, ":%d: ", line);
}
if (pedantic_errors)
errors++;
if (!pedantic_errors)
fprintf (stderr, "warning: ");
VA_START (args, msg); VA_START (args, msg);
#ifndef __STDC__ #ifndef __STDC__
...@@ -9585,6 +9578,15 @@ pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line, ...@@ -9585,6 +9578,15 @@ pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line,
msg = va_arg (args, char *); msg = va_arg (args, char *);
#endif #endif
if (file) {
eprint_string (file, file_len);
fprintf (stderr, ":%d: ", line);
}
if (pedantic_errors)
errors++;
if (!pedantic_errors)
fprintf (stderr, "warning: ");
vfprintf (stderr, msg, args); vfprintf (stderr, msg, args);
va_end (args); va_end (args);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
......
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