beanstalk fails to compile with gcc 4.6.0/libevent 2.0.10

109 views
Skip to first unread message

Jeremy Hinegardner

unread,
Feb 19, 2011, 12:10:04 AM2/19/11
to beansta...@googlegroups.com
Hi all,

I package beanstalk for Fedora and EPEL and with Fedora 15 the libevent
that is shipping is 2.0.10. It appears that beanstalk does not compile
with gcc 4.6.0 and/or libevent 2.0.10. These are the errors I recevied:

It gives a horrible error message with gcc, blaming stdio.h (http://pastie.org/1581314)

It was recommended to me to try and compile it using clang and see if it got a
better error message. clang does give a much better error messages. It looks
like there may be 2 issues.

% export CC=clang ./configure
[...]
% make
make all-am
make[1]: Entering directory `/home/fedora/jjh/packages/beanstalkd/beanstalkd-1.4.6'
clang -DHAVE_CONFIG_H -I. -g -O2 -Wall -Werror -I/usr/include -c -o beanstalkd.o beanstalkd.c
In file included from beanstalkd.c:37:
In file included from ./net.h:29:
In file included from ./conn.h:25:
./tube.h:38:16: error: field 'buried' with variable sized type 'struct job' not at the end of a struct or class is a GNU extension [-Wgnu]
struct job buried;
^
In file included from beanstalkd.c:37:
In file included from ./net.h:29:
./conn.h:75:16: error: field 'reserved_jobs' with variable sized type 'struct job' not at the end of a struct or class is a GNU extension
[-Wgnu]
struct job reserved_jobs; /* doubly-linked list header */
^

I moved these items to the end of their respective structs and tried again,
This time it turns out that there is some sort of conflict between the
dprintf() that is in util.h and an already existing dprintf() that is in
/usr/includ/stdio.h. This is probably the same issue that gcc found.

In file included from tube.c:25:
In file included from ./prot.h:22:
In file included from ./conn.h:23:
In file included from /usr/include/event.h:192:
In file included from /usr/include/event2/event.h:48:
/usr/include/stdio.h:419:12: error: expected identifier or '('
extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
^
In file included from tube.c:24:
In file included from ./tube.h:27:
In file included from ./job.h:28:
./util.h:48:29: note: instantiated from:
#define dprintf(fmt, ...) ((void) 0)
^

Any thoughts on these issues? I think we'll need to at least have the
dprintf issue resolved before beanstalk can packaged for F-15.

enjoy,

-jeremy

--
========================================================================
Jeremy Hinegardner jer...@hinegardner.org

k...@xph.us

unread,
Feb 19, 2011, 7:44:21 PM2/19/11
to beansta...@googlegroups.com, Jeremy Hinegardner
On Fri, Feb 18, 2011 at 9:10 PM, Jeremy Hinegardner
<jer...@hinegardner.org> wrote:
> Any thoughts on these issues?  I think we'll need to at least have the
> dprintf issue resolved before beanstalk can packaged for F-15.

The dprintf issue is fixed in git.

https://github.com/kr/beanstalkd/issues/49

I'll move the variable-sized structs to the end
of the structs that contain them, just as you did.

kr

Jeremy Hinegardner

unread,
Feb 19, 2011, 9:39:45 PM2/19/11
to k...@xph.us, beansta...@googlegroups.com
On Sat, Feb 19, 2011 at 04:44:21PM -0800, k...@xph.us wrote:
> On Fri, Feb 18, 2011 at 9:10 PM, Jeremy Hinegardner
> <jer...@hinegardner.org> wrote:
> > Any thoughts on these issues? ??I think we'll need to at least have the

> > dprintf issue resolved before beanstalk can packaged for F-15.
>
> The dprintf issue is fixed in git.
>
> https://github.com/kr/beanstalkd/issues/49
>
> I'll move the variable-sized structs to the end
> of the structs that contain them, just as you did.

Looks like I should have checked in the issue tracker. In any case,
do you think a new release might be possible?

Reply all
Reply to author
Forward
0 new messages