From d9dc87d8409ddf8361b7fcb311ae97088ed1d984 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 20 Aug 2013 06:02:29 +0200 Subject: Fix lots of -Wextra warnings Everything clang and GCC warn about, except GCC's missing-field-initializers which are just stupid as they don't allow {} syntax to zero a field. --- src/lex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lex.c') diff --git a/src/lex.c b/src/lex.c index 59599ee..9e68bc2 100644 --- a/src/lex.c +++ b/src/lex.c @@ -169,7 +169,7 @@ static void consume(fastd_lex_t *lex, bool needspace) { lex->needspace = needspace; } -static int io_error(YYSTYPE *yylval, fastd_lex_t *lex) { +static int io_error(YYSTYPE *yylval, fastd_lex_t *lex UNUSED) { yylval->error = "I/O error"; return -1; } @@ -354,7 +354,7 @@ static int parse_keyword(YYSTYPE *yylval, YYLTYPE *yylloc, fastd_lex_t *lex) { } char *token = get_token(lex); - const keyword_t key = {token}; + const keyword_t key = { .keyword = token }; const keyword_t *ret = bsearch(&key, keywords, sizeof(keywords)/sizeof(keyword_t), sizeof(keyword_t), compare_keywords); free(token); -- cgit v1.2.3