Marek Polacek
2014-10-06 09:54:00 UTC
Java testsuite breaks with -std=gnu11 as a default and/or with
-Wimplicit-function-declaration on, since the jvgenmain.c program
that generates a C file containing 'main' function which calls either
'JvRunMainName' or 'JvRunMain' does not generate forward declarations
for these functions. The fix is obvious IMHO.
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2014-10-06 Marek Polacek <***@redhat.com>
* jvgenmain.c: Generate forward declarations for JvRunMain{,Name}.
diff --git gcc/gcc/java/jvgenmain.c gcc/gcc/java/jvgenmain.c
index 5b14258..a786d31 100644
--- gcc/gcc/java/jvgenmain.c
+++ gcc/gcc/java/jvgenmain.c
@@ -127,6 +127,8 @@ main (int argc, char **argv)
/* At this point every element of ARGV from 1 to LAST_ARG is a `-D'
option. Process them appropriately. */
fprintf (stream, "extern const char **_Jv_Compiler_Properties;\n");
+ fprintf (stream, "extern void JvRunMain ();\n");
+ fprintf (stream, "extern void JvRunMainName ();\n");
fprintf (stream, "static const char *props[] =\n{\n");
for (i = 1; i < last_arg; ++i)
{
Marek
-Wimplicit-function-declaration on, since the jvgenmain.c program
that generates a C file containing 'main' function which calls either
'JvRunMainName' or 'JvRunMain' does not generate forward declarations
for these functions. The fix is obvious IMHO.
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2014-10-06 Marek Polacek <***@redhat.com>
* jvgenmain.c: Generate forward declarations for JvRunMain{,Name}.
diff --git gcc/gcc/java/jvgenmain.c gcc/gcc/java/jvgenmain.c
index 5b14258..a786d31 100644
--- gcc/gcc/java/jvgenmain.c
+++ gcc/gcc/java/jvgenmain.c
@@ -127,6 +127,8 @@ main (int argc, char **argv)
/* At this point every element of ARGV from 1 to LAST_ARG is a `-D'
option. Process them appropriately. */
fprintf (stream, "extern const char **_Jv_Compiler_Properties;\n");
+ fprintf (stream, "extern void JvRunMain ();\n");
+ fprintf (stream, "extern void JvRunMainName ();\n");
fprintf (stream, "static const char *props[] =\n{\n");
for (i = 1; i < last_arg; ++i)
{
Marek