From 3fdefbcc63ada60e2d6bca1dc5581f1cd3716ec1 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Wed, 28 Mar 2001 19:24:11 +0000 Subject: toplev.h (fatal_error): Add ATTRIBUTE_NORETURN. * toplev.h (fatal_error): Add ATTRIBUTE_NORETURN. * tradcif.y (yyerror): Likewise. Add format specifier in call to `error'. * tradcpp.c (macroexpand): Likewise for call to `error_with_line'. From-SVN: r40939 --- gcc/ChangeLog | 9 +++++++++ gcc/toplev.h | 1 + gcc/tradcif.y | 4 ++-- gcc/tradcpp.c | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d6bc063..0cd464b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2001-03-28 Kaveh R. Ghazi + + * toplev.h (fatal_error): Add ATTRIBUTE_NORETURN. + + * tradcif.y (yyerror): Likewise. Add format specifier in call to + `error'. + + * tradcpp.c (macroexpand): Likewise for call to `error_with_line'. + 2001-03-28 DJ Delorie * Makefile.in (stage1_build): Revert CFLAGS patch. diff --git a/gcc/toplev.h b/gcc/toplev.h index 6880e9f..bed92ae 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -69,6 +69,7 @@ extern void warning PARAMS ((const char *, ...)) extern void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1; extern void fatal_error PARAMS ((const char *, ...)) + ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1; extern void pedwarn PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1; diff --git a/gcc/tradcif.y b/gcc/tradcif.y index 877489d..5def3c9 100644 --- a/gcc/tradcif.y +++ b/gcc/tradcif.y @@ -28,7 +28,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include static int yylex PARAMS ((void)); - static void yyerror PARAMS ((const char *msgid)); + static void yyerror PARAMS ((const char *msgid)) ATTRIBUTE_NORETURN; static int parse_number PARAMS ((int)); static int parse_escape PARAMS ((const char **)); @@ -537,7 +537,7 @@ static void yyerror (s) const char *s; { - error (s); + error ("%s", s); longjmp (parse_return_error, 1); } diff --git a/gcc/tradcpp.c b/gcc/tradcpp.c index 82de0bb..d567473 100644 --- a/gcc/tradcpp.c +++ b/gcc/tradcpp.c @@ -4020,7 +4020,7 @@ macroexpand (hp, op) = macarg ((i < nargs || (nargs == 0 && i == 0)) ? &args[i] : 0); if (parse_error) { - error_with_line (line_for_error (start_line), parse_error); + error_with_line (line_for_error (start_line), "%s", parse_error); break; } i++; -- cgit v1.1