diff options
author | Michael Matz <matz@suse.de> | 2012-04-19 12:51:25 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2012-04-19 12:51:25 +0000 |
commit | 80f24351309c3322a48f5a58231fc13b8de74d4b (patch) | |
tree | f9d69da45f4b091c49a739bee0c4b6c58d9b5e0a /gcc | |
parent | d0a854af24839f665a04eaeb3f828c79587568cc (diff) | |
download | gcc-80f24351309c3322a48f5a58231fc13b8de74d4b.zip gcc-80f24351309c3322a48f5a58231fc13b8de74d4b.tar.gz gcc-80f24351309c3322a48f5a58231fc13b8de74d4b.tar.bz2 |
diagnostic.c (emit_diagnostic): Move va_end call after user of the va_list.
* diagnostic.c (emit_diagnostic): Move va_end call after user
of the va_list.
(warning, warning_at, pedwarn, permerror): Ditto.
From-SVN: r186591
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/diagnostic.c | 22 |
2 files changed, 22 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d127ca..655db81 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-04-19 Michael Matz <matz@suse.de> + + * diagnostic.c (emit_diagnostic): Move va_end call after user + of the va_list. + (warning, warning_at, pedwarn, permerror): Ditto. + 2012-04-19 Richard Guenther <rguenther@suse.de> * ira-int.h (ira_allocno_object_iter_cond): Avoid out-of-bound diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 60773d3..796a8f0 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -714,6 +714,7 @@ emit_diagnostic (diagnostic_t kind, location_t location, int opt, { diagnostic_info diagnostic; va_list ap; + bool ret; va_start (ap, gmsgid); if (kind == DK_PERMERROR) @@ -727,9 +728,10 @@ emit_diagnostic (diagnostic_t kind, location_t location, int opt, if (kind == DK_WARNING || kind == DK_PEDWARN) diagnostic.option_index = opt; } - va_end (ap); - return report_diagnostic (&diagnostic); + ret = report_diagnostic (&diagnostic); + va_end (ap); + return ret; } /* An informative note at LOCATION. Use this for additional details on an error @@ -771,13 +773,15 @@ warning (int opt, const char *gmsgid, ...) { diagnostic_info diagnostic; va_list ap; + bool ret; va_start (ap, gmsgid); diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_WARNING); diagnostic.option_index = opt; + ret = report_diagnostic (&diagnostic); va_end (ap); - return report_diagnostic (&diagnostic); + return ret; } /* A warning at LOCATION. Use this for code which is correct according to the @@ -789,12 +793,14 @@ warning_at (location_t location, int opt, const char *gmsgid, ...) { diagnostic_info diagnostic; va_list ap; + bool ret; va_start (ap, gmsgid); diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_WARNING); diagnostic.option_index = opt; + ret = report_diagnostic (&diagnostic); va_end (ap); - return report_diagnostic (&diagnostic); + return ret; } /* A "pedantic" warning at LOCATION: issues a warning unless @@ -815,12 +821,14 @@ pedwarn (location_t location, int opt, const char *gmsgid, ...) { diagnostic_info diagnostic; va_list ap; + bool ret; va_start (ap, gmsgid); diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_PEDWARN); diagnostic.option_index = opt; + ret = report_diagnostic (&diagnostic); va_end (ap); - return report_diagnostic (&diagnostic); + return ret; } /* A "permissive" error at LOCATION: issues an error unless @@ -835,13 +843,15 @@ permerror (location_t location, const char *gmsgid, ...) { diagnostic_info diagnostic; va_list ap; + bool ret; va_start (ap, gmsgid); diagnostic_set_info (&diagnostic, gmsgid, &ap, location, permissive_error_kind (global_dc)); diagnostic.option_index = permissive_error_option (global_dc); + ret = report_diagnostic (&diagnostic); va_end (ap); - return report_diagnostic (&diagnostic); + return ret; } /* A hard error: the code is definitely ill-formed, and an object file |