diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-09-25 07:49:07 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-09-25 07:49:07 +0000 |
commit | b256bec431f737b35a85383b11045f9833797b91 (patch) | |
tree | 4069f2eafc9c4602095bbf7c1b9678a0c132d780 /gcc/cccp.c | |
parent | 1ba4c06a2c5cfca98f456b82a0a82722e6d536d8 (diff) | |
download | gcc-b256bec431f737b35a85383b11045f9833797b91.tar.gz |
* cccp.c (pedwarn_with_file_and_line): For !__STDC__ case, avoid
accessing variables until they are initialized via va_arg().
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22585 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r-- | gcc/cccp.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c index 5afba12fad4..b39675d4c93 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"); |