gcc.misc-tests/linkage-y.c: Compatibility with C99+ system compilers

Message ID 874jhfi2k2.fsf@oldenburg.str.redhat.com
State Accepted
Headers
Series gcc.misc-tests/linkage-y.c: Compatibility with C99+ system compilers |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Florian Weimer Nov. 21, 2023, 2:49 p.m. UTC
  This program is compiled with an installed "cc" compiler, not the
built GCC compiler, so it should be as compatible as possible across a
wide range of compilers.

gcc/testsuite/

	* gcc.misc-tests/linkage-y.c (puts): Declare.
	(main): Add int return type and return 0.

---
 gcc/testsuite/gcc.misc-tests/linkage-y.c | 3 +++
 1 file changed, 3 insertions(+)


base-commit: 700d70e4a2874645ddb67a8a335131d83b242e69
  

Patch

diff --git a/gcc/testsuite/gcc.misc-tests/linkage-y.c b/gcc/testsuite/gcc.misc-tests/linkage-y.c
index eaffa5e4bb7..4235325f2cb 100644
--- a/gcc/testsuite/gcc.misc-tests/linkage-y.c
+++ b/gcc/testsuite/gcc.misc-tests/linkage-y.c
@@ -1,8 +1,11 @@ 
 /* 920717-y.c */
 
 extern const char s[];
+extern int puts(const char *);
 
+int
 main()
 {
 	puts(s);
+	return 0;
 }