New linker testsuite failure: PR 26094

Nick Clifton nickc@redhat.com
Thu Jun 11 08:27:27 GMT 2020


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.

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;
+}



More information about the Binutils mailing list