[pushed,gdb/testsuite] Fix Wreturn-mismatch in gdb.base/list-dot-nodebug.exp

Message ID 20240511075705.21874-1-tdevries@suse.de
State Committed
Headers
Series [pushed,gdb/testsuite] Fix Wreturn-mismatch in gdb.base/list-dot-nodebug.exp |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gdb_build--master-arm warning Patch is already merged

Commit Message

Tom de Vries May 11, 2024, 7:57 a.m. UTC
  When running test-case gdb.base/list-dot-nodebug.exp in a fedora rawhide
container, I run into:
...
temp/$pid/static-libc.c: In function 'main':
temp/$pid/static-libc.c:2:42: error: 'return' with a value, in function
 returning void [-Wreturn-mismatch]
    2 |                void main (void) { return 0; }
      |                                          ^
  ...
UNTESTED: gdb.base/list-dot-nodebug.exp: Can't statically link
...

Fix this by changing the return type to int.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/list-dot-nodebug.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 353f6a9bd17636b3a50ed706ce70995d6437b88c
  

Patch

diff --git a/gdb/testsuite/gdb.base/list-dot-nodebug.exp b/gdb/testsuite/gdb.base/list-dot-nodebug.exp
index 40256ca021a..c9d732e801b 100644
--- a/gdb/testsuite/gdb.base/list-dot-nodebug.exp
+++ b/gdb/testsuite/gdb.base/list-dot-nodebug.exp
@@ -23,7 +23,7 @@  set linkflags [list additional_flags="-static"]
 
 if { ![gdb_can_simple_compile static-libc \
 	   {
-	       void main (void) { return 0; }
+	       int main (void) { return 0; }
 	   } \
 	   executable $linkflags] } {
     untested "Can't statically link"