From cb854f9f1f893a9a966728db9bf22f8b159d1870 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 1 Apr 2016 15:38:37 +0200 Subject: [PATCH] lexer.h: Add WARN_UNUSED_RESULT to lex_force functions. There does not seem to be any sensible and safe use of these functions unless the return value is used somehow. --- src/language/lexer/lexer.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/language/lexer/lexer.h b/src/language/lexer/lexer.h index 03202e260b..7383927eef 100644 --- a/src/language/lexer/lexer.h +++ b/src/language/lexer/lexer.h @@ -124,13 +124,13 @@ bool lex_match_int (struct lexer *, int); bool lex_match_phrase (struct lexer *, const char *s); /* Forcible matching functions. */ -bool lex_force_match (struct lexer *, enum token_type); -bool lex_force_match_id (struct lexer *, const char *); -bool lex_force_int (struct lexer *); -bool lex_force_num (struct lexer *); -bool lex_force_id (struct lexer *); -bool lex_force_string (struct lexer *); -bool lex_force_string_or_id (struct lexer *); +bool lex_force_match (struct lexer *, enum token_type) WARN_UNUSED_RESULT; +bool lex_force_match_id (struct lexer *, const char *) WARN_UNUSED_RESULT; +bool lex_force_int (struct lexer *) WARN_UNUSED_RESULT; +bool lex_force_num (struct lexer *) WARN_UNUSED_RESULT; +bool lex_force_id (struct lexer *) WARN_UNUSED_RESULT; +bool lex_force_string (struct lexer *) WARN_UNUSED_RESULT; +bool lex_force_string_or_id (struct lexer *) WARN_UNUSED_RESULT; /* Token accessors. */ enum token_type lex_token (const struct lexer *); -- 2.30.2