From: Tom de Vries Date: Sat, 11 May 2024 07:56:45 +0000 (+0200) Subject: [gdb/testsuite] Fix Wreturn-mismatch in gdb.base/list-dot-nodebug.exp X-Git-Tag: gdb-15-branchpoint~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=14b1358663da4d79976e2ec3a1f4856e70287337;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix Wreturn-mismatch in gdb.base/list-dot-nodebug.exp 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. --- 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"