From: John Darrington Date: Fri, 1 Apr 2016 13:38:37 +0000 (+0200) Subject: lexer.h: Add WARN_UNUSED_RESULT to lex_force functions. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb854f9f1f893a9a966728db9bf22f8b159d1870;p=pspp 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. --- 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 *);