summaryrefslogtreecommitdiff
path: root/app/cwm/parse.y
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2015-01-16 18:28:09 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2015-01-16 18:28:09 +0000
commitb0147b7d38ab141208bd7c6cfa0746a596db8832 (patch)
tree0185afa8e80ae47fd7c2a64cc146f171f594f58b /app/cwm/parse.y
parent30f47ad2a5d36217d0540ce0a13dc1e3f4b7b0e7 (diff)
Add gcc format attributes for yyerror(); fix a few yyerror() calls.
Adapted from src parse.y changes by doug@. OK doug@
Diffstat (limited to 'app/cwm/parse.y')
-rw-r--r--app/cwm/parse.y16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/cwm/parse.y b/app/cwm/parse.y
index 40b706bf7..63b5def89 100644
--- a/app/cwm/parse.y
+++ b/app/cwm/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.58 2014/01/30 22:41:16 okan Exp $ */
+/* $OpenBSD: parse.y,v 1.59 2015/01/16 18:28:08 okan Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -47,7 +47,9 @@ struct file *pushfile(const char *);
int popfile(void);
int yyparse(void);
int yylex(void);
-int yyerror(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);
@@ -117,21 +119,21 @@ main : FONTNAME STRING {
}
| BORDERWIDTH NUMBER {
if ($2 < 0 || $2 > UINT_MAX) {
- yyerror("invalid borderwidth: %d", $2);
+ yyerror("invalid borderwidth: %lld", $2);
YYERROR;
}
conf->bwidth = $2;
}
| MOVEAMOUNT NUMBER {
if ($2 < 0 || $2 > INT_MAX) {
- yyerror("invalid movemount: %d", $2);
+ yyerror("invalid movemount: %lld", $2);
YYERROR;
}
conf->mamount = $2;
}
| SNAPDIST NUMBER {
if ($2 < 0 || $2 > INT_MAX) {
- yyerror("invalid snapdist: %d", $2);
+ yyerror("invalid snapdist: %lld", $2);
YYERROR;
}
conf->snapdist = $2;
@@ -149,7 +151,7 @@ main : FONTNAME STRING {
| AUTOGROUP NUMBER STRING {
if ($2 < 0 || $2 > 9) {
free($3);
- yyerror("invalid autogroup: %d", $2);
+ yyerror("invalid autogroup: %lld", $2);
YYERROR;
}
conf_autogroup(conf, $2, $3);
@@ -174,7 +176,7 @@ main : FONTNAME STRING {
$3 < 0 || $3 > INT_MAX ||
$4 < 0 || $4 > INT_MAX ||
$5 < 0 || $5 > INT_MAX) {
- yyerror("invalid gap: %d %d %d %d",
+ yyerror("invalid gap: %lld %lld %lld %lld",
$2, $3, $4, $5);
YYERROR;
}