From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2346 invoked by alias); 7 Oct 2014 08:31:37 -0000 Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org Received: (qmail 2325 invoked by uid 89); 7 Oct 2014 08:31:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 07 Oct 2014 08:31:34 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s978VXKK007624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Oct 2014 04:31:33 -0400 Received: from redhat.com (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s978VUss020533 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Tue, 7 Oct 2014 04:31:32 -0400 Date: Tue, 07 Oct 2014 08:31:00 -0000 From: Marek Polacek To: java-patches@gcc.gnu.org, GCC Patches Subject: [Java PATCH] Generate declarations in jvgenmain.c Message-ID: <20141007083129.GB3503@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2014-q4/txt/msg00014.txt.bz2 [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 * 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