[apparmor] [PATCH] libapparmor: Fix -Wunused-but-set-variable GCC warning

Tyler Hicks tyhicks at canonical.com
Fri Jan 29 21:18:37 UTC 2016


Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
---
 libraries/libapparmor/src/grammar.y | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libraries/libapparmor/src/grammar.y b/libraries/libapparmor/src/grammar.y
index 2a16d72..1dcc2f9 100644
--- a/libraries/libapparmor/src/grammar.y
+++ b/libraries/libapparmor/src/grammar.y
@@ -425,7 +425,6 @@ _parse_yacc(char *str)
 	/* yydebug = 1;  */
 	YY_BUFFER_STATE lex_buf;
 	yyscan_t scanner;
-	int parser_return;
 
 	ret_record = NULL;
 	ret_record = malloc(sizeof(aa_log_record));
@@ -441,7 +440,8 @@ _parse_yacc(char *str)
 
 	aalogparse_lex_init(&scanner);
 	lex_buf = aalogparse__scan_string(str, scanner);
-	parser_return = aalogparse_parse(scanner);
+	/* Ignore return value to return an AA_RECORD_INVALID event */
+	(void)aalogparse_parse(scanner);
 	aalogparse__delete_buffer(lex_buf, scanner);
 	aalogparse_lex_destroy(scanner);
 	return ret_record;
-- 
2.5.0




More information about the AppArmor mailing list