This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [Java PATCH] Generate declarations in jvgenmain.c
- From: Marek Polacek <polacek at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>
- Cc: java-patches at gcc dot gnu dot org, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 7 Oct 2014 18:15:19 +0200
- Subject: Re: [Java PATCH] Generate declarations in jvgenmain.c
- Authentication-results: sourceware.org; auth=none
- References: <20141007083129 dot GB3503 at redhat dot com> <87fvezrho1 dot fsf at tromey dot com>
On Tue, Oct 07, 2014 at 10:03:26AM -0600, Tom Tromey wrote:
> >>>>> "Marek" == Marek Polacek <polacek@redhat.com> writes:
>
> Marek> [CCing java-patches now]
> Marek> Java testsuite breaks with -std=gnu11 as a default and/or with
> Marek> -Wimplicit-function-declaration on
>
> I don't recall how one gets warnings when compiling this generated code,
> but if it is generally possible then I think this:
I'm not sure I understand, but this piece of code gets compiled when
running the libjava testsuite. And when the warning triggers, we get
many fails.
> Marek> + if (indirect)
> Marek> + fprintf (stream, "extern void JvRunMainName ();\n");
> Marek> + else
> Marek> + fprintf (stream, "extern void JvRunMain ();\n");
>
> ... will fail with -Wstrict-prototypes, since in C those should
> read "(void)" rather than "()".
>
> If it's not possible then no big deal.
I saw declarations of JvRunMain{,Name} with no parameters and with
some parameters. So I decided to make it prototype-less function
declaration for now. I think we don't have to worry about
-Wstrict-prototypes for now.
Marek