aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-09-25 07:49:07 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-09-25 07:49:07 +0000
commit36611067d5432e1c8642eed01cbf6b03defef540 (patch)
tree4069f2eafc9c4602095bbf7c1b9678a0c132d780 /gcc
parent8d62cb85ca45ff445d1aae923997c95de90b96f7 (diff)
downloadgcc-36611067d5432e1c8642eed01cbf6b03defef540.zip
gcc-36611067d5432e1c8642eed01cbf6b03defef540.tar.gz
gcc-36611067d5432e1c8642eed01cbf6b03defef540.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cccp.c18
2 files changed, 15 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a87537b..35bfd53 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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>
* reload1.c (reload_combine): Initialize set before using.
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 5afba12..b39675d 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -9568,14 +9568,7 @@ pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line,
if (!pedantic_errors && inhibit_warnings)
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);
#ifndef __STDC__
@@ -9585,6 +9578,15 @@ pedwarn_with_file_and_line VPROTO ((char *file, size_t file_len, int line,
msg = va_arg (args, char *);
#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);
va_end (args);
fprintf (stderr, "\n");