From: Marek Polacek <polacek@redhat.com>
To: java-patches@gcc.gnu.org, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [Java PATCH] Generate declarations in jvgenmain.c
Date: Tue, 07 Oct 2014 08:31:00 -0000 [thread overview]
Message-ID: <20141007083129.GB3503@redhat.com> (raw)
[CCing java-patches now]
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 following patch generates such a declaration
depending on whether -findirect-dispatch is given.
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2014-10-07 Marek Polacek <polacek@redhat.com>
* jvgenmain.c (main): Provide declaration for JvRunMain{,Name}.
diff --git gcc/java/jvgenmain.c gcc/java/jvgenmain.c
index 5b14258..82e468d 100644
--- gcc/java/jvgenmain.c
+++ gcc/java/jvgenmain.c
@@ -127,6 +127,10 @@ 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");
+ if (indirect)
+ fprintf (stream, "extern void JvRunMainName ();\n");
+ else
+ fprintf (stream, "extern void JvRunMain ();\n");
fprintf (stream, "static const char *props[] =\n{\n");
for (i = 1; i < last_arg; ++i)
{
Marek
next reply other threads:[~2014-10-07 8:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-07 8:31 Marek Polacek [this message]
2014-10-07 12:21 ` Andrew Haley
2014-10-07 16:03 ` Tom Tromey
2014-10-07 16:15 ` Marek Polacek
2014-10-07 16:41 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141007083129.GB3503@redhat.com \
--to=polacek@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=java-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).