aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-02-15 06:08:23 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-02-15 06:08:23 +0000
commit0177e0c52ba6ca0ff8b452c9c106000dd3fc85aa (patch)
tree68421ffe727a01f9e9a4a55ebc8b99cce98da16e /tools
parent743e906899eb25b0df158f95394a5cfc1a5d765c (diff)
More paranoia - when compiling with GCC 2.x, do checks of the format
string argument and subsequent arguments to "ErrorMsg()". Fix up the bugs the checks in question found. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3038 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tools')
-rw-r--r--tools/lemon/lemon.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c
index b99b0de646..9b7679057b 100644
--- a/tools/lemon/lemon.c
+++ b/tools/lemon/lemon.c
@@ -25,7 +25,7 @@
** drh@acm.org
** http://www.hwaci.com/drh/
**
-** $Id: lemon.c,v 1.3 2001/02/15 06:01:23 guy Exp $
+** $Id: lemon.c,v 1.4 2001/02/15 06:08:23 guy Exp $
*/
#include <stdio.h>
#include <stdarg.h>
@@ -263,7 +263,12 @@ void Configlist_eat(struct config *);
void Configlist_reset(void);
/********* From the file "error.h" ***************************************/
+#if __GNUC__ == 2
+void ErrorMsg( char *, int, char *, ... )
+ __attribute__((format (printf, 3, 4)));
+#else
void ErrorMsg( char *, int, char *, ... );
+#endif
/****** From the file "option.h" ******************************************/
struct s_options {
@@ -2025,7 +2030,7 @@ to follow the previous rule.");
case WAITING_FOR_DESTRUCTOR_SYMBOL:
if( !safe_isalpha(x[0]) ){
ErrorMsg(psp->filename,psp->tokenlineno,
- "Symbol name missing after %destructor keyword");
+ "Symbol name missing after %%destructor keyword");
psp->errorcnt++;
psp->state = RESYNC_AFTER_DECL_ERROR;
}else{
@@ -2038,7 +2043,7 @@ to follow the previous rule.");
case WAITING_FOR_DATATYPE_SYMBOL:
if( !safe_isalpha(x[0]) ){
ErrorMsg(psp->filename,psp->tokenlineno,
- "Symbol name missing after %destructor keyword");
+ "Symbol name missing after %%destructor keyword");
psp->errorcnt++;
psp->state = RESYNC_AFTER_DECL_ERROR;
}else{