From: David Aguilar <davvid@gmail.com>
To: Fredrik Kuivinen <frekui@gmail.com>
Cc: Brian Gernhardt <brian@gernhardtsoftware.com>,
Git List <git@vger.kernel.org>
Subject: Re: obstack fails to compile on OS X 10.7
Date: Sun, 28 Aug 2011 20:18:08 -0700 [thread overview]
Message-ID: <20110829031806.GA58338@gmail.com> (raw)
In-Reply-To: <20110828200846.GA10754@fredrik-Q430-Q530>
On Sun, Aug 28, 2011 at 10:08:46PM +0200, Fredrik Kuivinen wrote:
> On Sat, Aug 27, 2011 at 03:14:43AM -0700, David Aguilar wrote:
> > On Sat, Aug 27, 2011 at 02:21:40AM -0400, Brian Gernhardt wrote:
> > > Some of the errors look like things I could track down, but some just confuse me. If anyone else could take a look into this, it would be much appreciated.
> > >
> > > ~~ Brian G.
> > >
> > > gcc -o compat/obstack.o -c -MF compat/.depend/obstack.o.d -MMD -MP -Wall -Wdeclaration-after-statement -Werror -Wno-deprecated-declarations -I. -DUSE_ST_TIMESPEC -DSHA1_HEADER='"block-sha1/sha1.h"' -DNO_MEMMEM compat/obstack.c
> > > In file included from compat/obstack.c:30:
> > > compat/obstack.h:190: error: __block attribute can be specified on variables only
> > > compat/obstack.c:70: error: expected specifier-qualifier-list before ‘uintmax_t’
> > > compat/obstack.c:111:24: error: exitfail.h: No such file or directory
> > > cc1: warnings being treated as errors
> > > compat/obstack.c: In function ‘print_and_abort’:
> > > compat/obstack.c:436: warning: implicit declaration of function ‘gettext’
> > > compat/obstack.c:436: warning: incompatible implicit declaration of built-in function ‘gettext’
> > > compat/obstack.c:438: error: ‘exit_failure’ undeclared (first use in this function)
> > > compat/obstack.c:438: error: (Each undeclared identifier is reported only once
> > > compat/obstack.c:438: error: for each function it appears in.)
> > > compat/obstack.c:439: warning: ‘noreturn’ function does return
> > > make: *** [compat/obstack.o] Error 1
> > >
> > > $ gcc --version
> > > i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
> >
> > I ran into the same thing.
> >
> > This fixes it for me, but we might want to rearrange the
> > #includes a bit. I think this needs more work.. including
> > compat/obstack.h from kwset.c seems wrong.
> > Should we just include obstack.h in git-compat-util instead?
> >
> > I suspect that more exotic platforms may have problems
> > with obstack.h as well. This probably needs some testing
> > on SunOS, AIX, IRIX, etc.
>
>
> How about doing something a bit simpler instead and changing obstack.c
> to not make use of exit.h and exitfail.h? Then we don't have to update
> Makefile for all platforms needing NEEDS_OBSTACK and NEEDS_EXITFAIL.
I like this much better. Less code is better code.
> I don't understand why the ELIDE_CODE check is not sufficient. Care to
> explain?
I can't say I know. The intention of the check is to avoid
pulling in that section of code when it is already built-in to
the C library. Maybe that check doesn't quite mean the same
thing when the file is used alone outside of its original
context?
> -void obstack_free (struct obstack *__obstack, void *__block);
> +void obstack_free (struct obstack *obstack, void *block);
Tiny nit: I know it's just a declaration but would it be
advisable to drop the variable names altogether here?
Having a pointer and a structure with the same "obstack"
name could be confusing.
This looks good otherwise. I was a bit iffy about my patch
when I had to bring in the extra headers.
Doing without them is much better.
I tried your patch on top of my recent
"Improve compiler header dependency check" and it worked fine.
So...
Tested-by: David Aguilar <davvid@gmail.com>
--
David
next prev parent reply other threads:[~2011-08-29 3:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-27 6:21 obstack fails to compile on OS X 10.7 Brian Gernhardt
2011-08-27 10:14 ` David Aguilar
2011-08-28 3:57 ` Brian Gernhardt
2011-08-28 20:08 ` Fredrik Kuivinen
2011-08-29 3:18 ` David Aguilar [this message]
2011-08-29 6:07 ` Junio C Hamano
2011-09-01 17:30 ` Ramsay Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110829031806.GA58338@gmail.com \
--to=davvid@gmail.com \
--cc=brian@gernhardtsoftware.com \
--cc=frekui@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.