From unknown Mon Jun 23 09:39:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6170: 24.0.50; Compiling on solaris2.10 with gcc doesn't define alloca Resent-From: Lawrence Mitchell Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 May 2010 11:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6170 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 6170@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.127357561631755 (code B ref -1); Tue, 11 May 2010 11:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 May 2010 11:00:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnCB-0008G8-NK for submit@debbugs.gnu.org; Tue, 11 May 2010 07:00:16 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnC9-0008G0-9N for submit@debbugs.gnu.org; Tue, 11 May 2010 07:00:14 -0400 Received: from lists.gnu.org ([199.232.76.165]:38801) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OBnC3-0002SH-7h for submit@debbugs.gnu.org; Tue, 11 May 2010 07:00:07 -0400 Received: from [140.186.70.92] (port=49740 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBnBz-0000sS-81 for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 07:00:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL,URIBL_BLACK autolearn=no version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBnAz-0005kh-9o for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 06:59:02 -0400 Received: from e450.epcc.ed.ac.uk ([129.215.56.230]:39061) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnAy-0005k3-Vk for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 06:59:01 -0400 Received: from garnet.epcc.ed.ac.uk (garnet.epcc.ed.ac.uk [129.215.56.222]) by e450.epcc.ed.ac.uk (8.13.6/8.13.6) with ESMTP id o4BAwqvc006881 for ; Tue, 11 May 2010 11:58:52 +0100 (BST) Received: from garnet.epcc.ed.ac.uk (localhost [127.0.0.1]) by garnet.epcc.ed.ac.uk (8.13.8+Sun/8.12.8) with ESMTP id o4BAvHdV012767 for ; Tue, 11 May 2010 11:57:17 +0100 (BST) Received: (from lmitche4@localhost) by garnet.epcc.ed.ac.uk (8.13.8+Sun/8.13.8/Submit) id o4BAvHtK012764; Tue, 11 May 2010 11:57:17 +0100 (BST) X-Authentication-Warning: garnet.epcc.ed.ac.uk: lmitche4 set sender to lawrence.mitchell@ed.ac.uk using -f From: Lawrence Mitchell Date: Tue, 11 May 2010 11:57:17 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Edinburgh-Scanned: at mailhost.epcc.ed.ac.uk X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-detected-operating-system: by eggs.gnu.org: Solaris 8 (1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -3.2 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) On this system, is provided by Sun and therefore doesn't define alloca, unlike on a typical GNU/linux system where contains the following: | #if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC | # include | #endif /* Use GNU, BSD, or misc. */ When compiling emacs with gcc, alloca is therefore undefined. The culprit is this snippet in configure.in: | #ifndef __GNUC__ | # ifdef HAVE_ALLOCA_H | # include | # else /* AIX files deal with #pragma. */ | # ifndef alloca /* predefined by HP cc +Olibcalls */ | char *alloca (); | # endif | # endif /* HAVE_ALLOCA_H */ | #endif /* __GNUC__ */ On this system, configure correctly defines both HAVE_ALLOCA_H and HAVE_ALLOCA, but since the inclusion is guarded by __GNUC__ not being defined, we never include . I think the correct fix is to unconditionally define alloca if __GNUC__ is detected, see patch below. Note that this is closer to how autoconf checks for the presence of the alloca function. Possible changelog entry: 2010-05-11 Lawrence Mitchell * configure.in: Unconditionally define alloca if __GNUC__ is detected. diff --git a/configure.in b/configure.in index 8a7d9be..98b6abb 100644 --- a/configure.in +++ b/configure.in @@ -3360,6 +3360,9 @@ extern char *getenv (); char *alloca (); # endif # endif /* HAVE_ALLOCA_H */ +#else +# undef alloca +# define alloca __builtin_alloca #endif /* __GNUC__ */ #ifndef HAVE_SIZE_T typedef unsigned size_t; From unknown Mon Jun 23 09:39:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6170: 24.0.50; Compiling on solaris2.10 with gcc doesn't define alloca Resent-From: Dan Nicolaescu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 May 2010 18:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6170 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lawrence Mitchell Cc: 6170@debbugs.gnu.org Received: via spool by 6170-submit@debbugs.gnu.org id=B6170.127368898728025 (code B ref 6170); Wed, 12 May 2010 18:30:03 +0000 Received: (at 6170) by debbugs.gnu.org; 12 May 2010 18:29:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCGgk-0007Hy-T0 for submit@debbugs.gnu.org; Wed, 12 May 2010 14:29:47 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCGgj-0007Hs-8h for 6170@debbugs.gnu.org; Wed, 12 May 2010 14:29:45 -0400 Received: from dann by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OCGge-0004gP-IQ; Wed, 12 May 2010 14:29:40 -0400 References: From: Dan Nicolaescu Date: Wed, 12 May 2010 14:29:40 -0400 In-Reply-To: (Lawrence Mitchell's message of "Tue\, 11 May 2010 11\:57\:17 +0100") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.6 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) Lawrence Mitchell writes: > On this system, is provided by Sun and therefore > doesn't define alloca, unlike on a typical GNU/linux system where > contains the following: > > | #if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC > | # include > | #endif /* Use GNU, BSD, or misc. */ > > When compiling emacs with gcc, alloca is therefore undefined. > The culprit is this snippet in configure.in: > > | #ifndef __GNUC__ > | # ifdef HAVE_ALLOCA_H > | # include > | # else /* AIX files deal with #pragma. */ > | # ifndef alloca /* predefined by HP cc +Olibcalls */ > | char *alloca (); > | # endif > | # endif /* HAVE_ALLOCA_H */ > | #endif /* __GNUC__ */ > "info autoconf" says that this is the proper way to do it: #ifdef HAVE_ALLOCA_H # include #elif defined __GNUC__ # define alloca __builtin_alloca #elif defined _AIX # define alloca __alloca #elif defined _MSC_VER # include # define alloca _alloca #else # include # ifdef __cplusplus extern "C" # endif void *alloca (size_t); #endif Not sure we need the last #else part, or the _MSC_VER part... From unknown Mon Jun 23 09:39:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6170: 24.0.50; Compiling on solaris2.10 with gcc doesn't define alloca In-Reply-To: Resent-From: Lawrence Mitchell Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 May 2010 16:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6170 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.127532430822063 (code B ref -1); Mon, 31 May 2010 16:46:02 +0000 Received: (at submit) by debbugs.gnu.org; 31 May 2010 16:45:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJ86t-0005jo-1v for submit@debbugs.gnu.org; Mon, 31 May 2010 12:45:07 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJ86p-0005j8-UB for submit@debbugs.gnu.org; Mon, 31 May 2010 12:45:05 -0400 Received: from lists.gnu.org ([199.232.76.165]:51935) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OJ86n-00021z-59 for submit@debbugs.gnu.org; Mon, 31 May 2010 12:45:01 -0400 Received: from [140.186.70.92] (port=58128 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJ86l-0002JS-7f for bug-gnu-emacs@gnu.org; Mon, 31 May 2010 12:45:00 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJ86i-0003qq-4e for bug-gnu-emacs@gnu.org; Mon, 31 May 2010 12:44:57 -0400 Received: from lo.gmane.org ([80.91.229.12]:52461) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJ86h-0003qZ-VT for bug-gnu-emacs@gnu.org; Mon, 31 May 2010 12:44:56 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OJ86f-0001b8-Fk for bug-gnu-emacs@gnu.org; Mon, 31 May 2010 18:44:53 +0200 Received: from garnet.epcc.ed.ac.uk ([129.215.56.222]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 31 May 2010 18:44:53 +0200 Received: from wence by garnet.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 31 May 2010 18:44:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ connect(): No such file or directory From: Lawrence Mitchell Date: Mon, 31 May 2010 17:42:34 +0100 Lines: 54 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: garnet.epcc.ed.ac.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (usg-unix-v) Cancel-Lock: sha1:o8/jk71MQ/DCfGcVdlrqQRDABEU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -2.7 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.8 (---) Dan Nicolaescu wrote: > Lawrence Mitchell writes: >> On this system, is provided by Sun and therefore >> doesn't define alloca, unlike on a typical GNU/linux system where >> contains the following: >> | #if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC >> | # include >> | #endif /* Use GNU, BSD, or misc. */ >> When compiling emacs with gcc, alloca is therefore undefined. >> The culprit is this snippet in configure.in: >> | #ifndef __GNUC__ >> | # ifdef HAVE_ALLOCA_H >> | # include >> | # else /* AIX files deal with #pragma. */ >> | # ifndef alloca /* predefined by HP cc +Olibcalls */ >> | char *alloca (); >> | # endif >> | # endif /* HAVE_ALLOCA_H */ >> | #endif /* __GNUC__ */ > "info autoconf" says that this is the proper way to do it: > #ifdef HAVE_ALLOCA_H > # include > #elif defined __GNUC__ > # define alloca __builtin_alloca > #elif defined _AIX > # define alloca __alloca > #elif defined _MSC_VER > # include > # define alloca _alloca > #else > # include > # ifdef __cplusplus > extern "C" > # endif > void *alloca (size_t); > #endif > Not sure we need the last #else part, or the _MSC_VER part... Is there any movement on getting this fix, or something like it, installed? It doesn't seem like a controversial change. Cheers, Lawrence -- Lawrence Mitchell From unknown Mon Jun 23 09:39:02 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Lawrence Mitchell Subject: bug#6170: closed (Re: bug#6170: 24.0.50; Compiling on solaris2.10 with gcc doesn't define alloca) Message-ID: References: X-Gnu-PR-Message: they-closed 6170 X-Gnu-PR-Package: emacs Reply-To: 6170@debbugs.gnu.org Date: Wed, 02 Jun 2010 09:25:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1275470702-2081-1" This is a multi-part message in MIME format... ------------=_1275470702-2081-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #6170: 24.0.50; Compiling on solaris2.10 with gcc doesn't define alloca which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 6170@debbugs.gnu.org. --=20 6170: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D6170 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1275470702-2081-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 6170-done) by debbugs.gnu.org; 2 Jun 2010 09:24:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJkBk-0000XN-FN for submit@debbugs.gnu.org; Wed, 02 Jun 2010 05:24:40 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJkBj-0000XH-6S for 6170-done@debbugs.gnu.org; Wed, 02 Jun 2010 05:24:40 -0400 Received: from dann by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OJkBg-0007LG-92; Wed, 02 Jun 2010 05:24:36 -0400 To: Lawrence Mitchell Subject: Re: bug#6170: 24.0.50; Compiling on solaris2.10 with gcc doesn't define alloca References: From: Dan Nicolaescu X-Debbugs-No-Ack: yes Date: Wed, 02 Jun 2010 05:24:36 -0400 In-Reply-To: (Lawrence Mitchell's message of "Mon\, 31 May 2010 17\:42\:34 +0100") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.6 (----) X-Debbugs-Envelope-To: 6170-done Cc: 6170-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) Lawrence Mitchell writes: > Dan Nicolaescu wrote: >> Lawrence Mitchell writes: > >>> On this system, is provided by Sun and therefore >>> doesn't define alloca, unlike on a typical GNU/linux system where >>> contains the following: > >>> | #if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC >>> | # include >>> | #endif /* Use GNU, BSD, or misc. */ > >>> When compiling emacs with gcc, alloca is therefore undefined. >>> The culprit is this snippet in configure.in: > >>> | #ifndef __GNUC__ >>> | # ifdef HAVE_ALLOCA_H >>> | # include >>> | # else /* AIX files deal with #pragma. */ >>> | # ifndef alloca /* predefined by HP cc +Olibcalls */ >>> | char *alloca (); >>> | # endif >>> | # endif /* HAVE_ALLOCA_H */ >>> | #endif /* __GNUC__ */ > > >> "info autoconf" says that this is the proper way to do it: > >> #ifdef HAVE_ALLOCA_H >> # include >> #elif defined __GNUC__ >> # define alloca __builtin_alloca >> #elif defined _AIX >> # define alloca __alloca >> #elif defined _MSC_VER >> # include >> # define alloca _alloca >> #else >> # include >> # ifdef __cplusplus >> extern "C" >> # endif >> void *alloca (size_t); >> #endif > >> Not sure we need the last #else part, or the _MSC_VER part... > > Is there any movement on getting this fix, or something like it, > installed? It doesn't seem like a controversial change. Should be fixed now. ------------=_1275470702-2081-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 11 May 2010 11:00:16 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnCB-0008G8-NK for submit@debbugs.gnu.org; Tue, 11 May 2010 07:00:16 -0400 Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnC9-0008G0-9N for submit@debbugs.gnu.org; Tue, 11 May 2010 07:00:14 -0400 Received: from lists.gnu.org ([199.232.76.165]:38801) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OBnC3-0002SH-7h for submit@debbugs.gnu.org; Tue, 11 May 2010 07:00:07 -0400 Received: from [140.186.70.92] (port=49740 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBnBz-0000sS-81 for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 07:00:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL,URIBL_BLACK autolearn=no version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBnAz-0005kh-9o for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 06:59:02 -0400 Received: from e450.epcc.ed.ac.uk ([129.215.56.230]:39061) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBnAy-0005k3-Vk for bug-gnu-emacs@gnu.org; Tue, 11 May 2010 06:59:01 -0400 Received: from garnet.epcc.ed.ac.uk (garnet.epcc.ed.ac.uk [129.215.56.222]) by e450.epcc.ed.ac.uk (8.13.6/8.13.6) with ESMTP id o4BAwqvc006881 for ; Tue, 11 May 2010 11:58:52 +0100 (BST) Received: from garnet.epcc.ed.ac.uk (localhost [127.0.0.1]) by garnet.epcc.ed.ac.uk (8.13.8+Sun/8.12.8) with ESMTP id o4BAvHdV012767 for ; Tue, 11 May 2010 11:57:17 +0100 (BST) Received: (from lmitche4@localhost) by garnet.epcc.ed.ac.uk (8.13.8+Sun/8.13.8/Submit) id o4BAvHtK012764; Tue, 11 May 2010 11:57:17 +0100 (BST) X-Authentication-Warning: garnet.epcc.ed.ac.uk: lmitche4 set sender to lawrence.mitchell@ed.ac.uk using -f From: Lawrence Mitchell To: bug-gnu-emacs@gnu.org Subject: 24.0.50; Compiling on solaris2.10 with gcc doesn't define alloca Date: Tue, 11 May 2010 11:57:17 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Edinburgh-Scanned: at mailhost.epcc.ed.ac.uk X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-detected-operating-system: by eggs.gnu.org: Solaris 8 (1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.3 (----) On this system, is provided by Sun and therefore doesn't define alloca, unlike on a typical GNU/linux system where contains the following: | #if defined __USE_GNU || defined __USE_BSD || defined __USE_MISC | # include | #endif /* Use GNU, BSD, or misc. */ When compiling emacs with gcc, alloca is therefore undefined. The culprit is this snippet in configure.in: | #ifndef __GNUC__ | # ifdef HAVE_ALLOCA_H | # include | # else /* AIX files deal with #pragma. */ | # ifndef alloca /* predefined by HP cc +Olibcalls */ | char *alloca (); | # endif | # endif /* HAVE_ALLOCA_H */ | #endif /* __GNUC__ */ On this system, configure correctly defines both HAVE_ALLOCA_H and HAVE_ALLOCA, but since the inclusion is guarded by __GNUC__ not being defined, we never include . I think the correct fix is to unconditionally define alloca if __GNUC__ is detected, see patch below. Note that this is closer to how autoconf checks for the presence of the alloca function. Possible changelog entry: 2010-05-11 Lawrence Mitchell * configure.in: Unconditionally define alloca if __GNUC__ is detected. diff --git a/configure.in b/configure.in index 8a7d9be..98b6abb 100644 --- a/configure.in +++ b/configure.in @@ -3360,6 +3360,9 @@ extern char *getenv (); char *alloca (); # endif # endif /* HAVE_ALLOCA_H */ +#else +# undef alloca +# define alloca __builtin_alloca #endif /* __GNUC__ */ #ifndef HAVE_SIZE_T typedef unsigned size_t; ------------=_1275470702-2081-1--