emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alloca() warnings on freebsd


From: Dan Nicolaescu
Subject: Re: alloca() warnings on freebsd
Date: Mon, 09 Aug 2010 19:16:33 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Giorgos Keramidas <address@hidden> writes:

> Some time during the recent past an alloca() prototype was introduced to
> config.h that conflicts with the stdlib.h prototype of alloca() on my
> FreeBSD laptop.
>
> The current check near line 1148 of config.in is:
>
>     #ifdef HAVE_ALLOCA_H
>     # include <alloca.h>
>     #elif defined __GNUC__
>     # define alloca __builtin_alloca
>     #elif defined _AIX
>     # define alloca __alloca
>     #else
>     # include <stddef.h>
>     # ifdef  __cplusplus
>     extern "C"
>     # endif
>     void *alloca (size_t);
>     #endif
>
> The tricky bit is that FreeBSD *does* have alloca() but not alloca.h, so
> the final #else part declares a redundant prototype.  This causes a very
> minor but frequent warning for all source files that include config.h:
>
>     In file included from /hg/emacs/gker/lib-src/test-distrib.c:23:
>     ../src/config.h:1152:1: warning: "alloca" redefined
>     In file included from ../src/config.h:1146,
>                      from /hg/emacs/gker/lib-src/test-distrib.c:23:
>     /usr/include/stdlib.h:233:1: warning: this is the location of the 
> previous definition
>     ...
>
> The attached patch is an attempt to fix this for FreeBSD without
> breaking alloca() on other platforms.
>
> Does it look ok for trunk?

What we use now is a shorter version what the autoconf manual recommends.
Could you ask the autoconf guys about this, and post the solution here?
That would help fix the same problem for other programs, not only for emacs.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]