From 53ae0aa9c65bc41b6f67f52a657b9f5339a331be Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 1 May 2020 11:04:22 +0200 Subject: [gdb/testsuite] Fix Wunused-result warning in until-reverse.c When running test-case gdb.reverse/until-reverse.exp or gdb.reverse/until-precsave.exp with gcc-10, we run into a Wunused-result warning: ... gdb compile failed, gdb.reverse/until-reverse.c: In function 'main': gdb.reverse/until-reverse.c:40:14: warning: ignoring return value of \ 'malloc' declared with attribute 'warn_unused_result' [-Wunused-result] 40 | (void) malloc (1); | ^~~~~~~~~~ ... Fix this by using the result of malloc as argument to a free call. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-05-01 Tom de Vries * gdb.reverse/until-reverse.c (main): Fix Wunused-result warning. --- gdb/testsuite/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/testsuite/ChangeLog') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e2bf45b..210499a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-05-01 Tom de Vries + + * gdb.reverse/until-reverse.c (main): Fix Wunused-result warning. + 2020-04-30 Hannes Domani PR gdb/18706 -- cgit v1.1