lexer.h: Add WARN_UNUSED_RESULT to lex_force functions.
authorJohn Darrington <john@darrington.wattle.id.au>
Fri, 1 Apr 2016 13:38:37 +0000 (15:38 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Fri, 1 Apr 2016 13:38:55 +0000 (15:38 +0200)
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

index 03202e260b64e4386af93b429d39f99b29bce5e7..7383927eef9cedb8b25e1b640fb3a8a6dc82b4a4 100644 (file)
@@ -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 *);