aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-11-30 23:00:57 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-11-30 23:00:57 +0000
commit29ced803f03dd87aa478f44844c4405db9196651 (patch)
tree2c2c2f7cf77f5cffe2d41baeb857e72ba60626e7 /gcc
parent25e4379fe54884cd49f653bc97ddf98f89d8c796 (diff)
downloadgcc-29ced803f03dd87aa478f44844c4405db9196651.zip
gcc-29ced803f03dd87aa478f44844c4405db9196651.tar.gz
gcc-29ced803f03dd87aa478f44844c4405db9196651.tar.bz2
* c-common.c (status_warning) [! ANSI_PROTOTYPES]: Load status
from va_list before using it. From-SVN: r37900
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-common.c18
2 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dbb46a5..761488d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-30 Alexandre Oliva <aoliva@redhat.com>
+
+ * c-common.c (status_warning) [! ANSI_PROTOTYPES]: Load status
+ from va_list before using it.
+
2000-11-30 Michael Matz <matzmich@cs.tu-berlin.de>
* flow.c (make_edge): Early out, if no flags to set.
diff --git a/gcc/c-common.c b/gcc/c-common.c
index d59386d..cb6b78f 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -2021,24 +2021,24 @@ status_warning VPARAMS ((int *status, const char *msgid, ...))
va_list ap;
diagnostic_context dc;
- if (status)
- *status = 1;
- else
- {
- VA_START (ap, msgid);
+ VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
- status = va_arg (ap, int *);
- msgid = va_arg (ap, const char *);
+ status = va_arg (ap, int *);
+ msgid = va_arg (ap, const char *);
#endif
+ if (status)
+ *status = 1;
+ else
+ {
/* This duplicates the warning function behavior. */
set_diagnostic_context
(&dc, msgid, &ap, input_filename, lineno, /* warn = */ 1);
report_diagnostic (&dc);
-
- va_end (ap);
}
+
+ va_end (ap);
}
/* Variables used by the checking of $ operand number formats. */