New linker testsuite failure: PR 26094

Message ID 87ftb2vwgg.fsf@redhat.com
State New
Headers show
Series
  • New linker testsuite failure: PR 26094
Related show

Commit Message

David Faust via Binutils June 11, 2020, 8:27 a.m.
Hi H.J.

  My linker tests as showing up a new failure for the PR 26094 test:

    ERROR: ld/testsuite/ld-elf/pr26094-1b.c: compilation failed

  Which comes from:

    ld/testsuite/ld-elf/pr26094-1b.c:3:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
    ld/testsuite/ld-elf/pr26094-1b.c:3:1: note: change return type to
    'int'

  The twist is that these errors only show up when compiling with clang
  rather than gcc...

  Anyway I have gone ahead and applied the patch below as an obvious
  fix.

Cheers
  Nick

ld/ChangeLog
2020-06-11  Nick Clifton  <nickc@redhat.com>

	* testsuite/ld-elf/pr26094-1b.c (main): Change return type to
	int.

Patch

diff --git a/ld/testsuite/ld-elf/pr26094-1b.c b/ld/testsuite/ld-elf/pr26094-1b.c
index 650a36fd89..9d34049984 100644
--- a/ld/testsuite/ld-elf/pr26094-1b.c
+++ b/ld/testsuite/ld-elf/pr26094-1b.c
@@ -1,6 +1,6 @@ 
 extern void *foo();
 
-void main()
+int main (void)
 {
-    foo();
-}
\ No newline at end of file
+  foo(); return 0;
+}