summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hogan <doug@cvs.openbsd.org>2014-11-14 03:22:48 +0000
committerDoug Hogan <doug@cvs.openbsd.org>2014-11-14 03:22:48 +0000
commitc189a2bcaf4b8a56cb6b97f82398ad396d1011e8 (patch)
tree6102b23907b7dd72ea2ead2e1f61f85c3f05949e
parent5b2bd120efc36e43885fddaf159431fe0dfee19d (diff)
Add gcc printf format attributes to iked's parse.y and remove unused
yywarn() definition. ok bluhm@
-rw-r--r--sbin/iked/parse.y20
1 files changed, 4 insertions, 16 deletions
diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y
index ba300bfc427..0e44806d310 100644
--- a/sbin/iked/parse.y
+++ b/sbin/iked/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.40 2014/08/27 10:28:57 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.41 2014/11/14 03:22:47 doug Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -66,8 +66,9 @@ int check_file_secrecy(int, const char *);
int check_pubkey(char *, int );
int yyparse(void);
int yylex(void);
-int yyerror(const char *, ...);
-int yywarn(const char *, ...);
+int yyerror(const char *, ...)
+ __attribute__((__format__ (printf, 1, 2)))
+ __attribute__((__nonnull__ (1)));
int kw_cmp(const void *, const void *);
int lookup(char *);
int lgetc(int);
@@ -1059,19 +1060,6 @@ yyerror(const char *fmt, ...)
}
int
-yywarn(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
- fprintf(stderr, "%s: %d: ", file->name, yylval.lineno);
- vfprintf(stderr, fmt, ap);
- fprintf(stderr, "\n");
- va_end(ap);
- return (0);
-}
-
-int
kw_cmp(const void *k, const void *e)
{
return (strcmp(k, ((const struct keywords *)e)->k_name));