git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: Shawn Pearce <spearce@spearce.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [PATCH] Remove more gcc extension usage.
Date: Sun, 9 Jul 2006 09:31:55 +0200	[thread overview]
Message-ID: <20060709073155.GP22573@lug-owl.de> (raw)
In-Reply-To: <20060708190327.GA17763@spearce.org>

[-- Attachment #1: Type: text/plain, Size: 2785 bytes --]

On Sat, 2006-07-08 15:03:27 -0400, Shawn Pearce <spearce@spearce.org> wrote:
> Junio C Hamano <junkio@cox.net> wrote:
> > Shawn Pearce <spearce@spearce.org> writes:
> > 
> > > Removing these last remaining extension uses allows GIT to compile
> > > with the Sun C compiler rather then gcc.  This can be handy when
> > > you are trying to compile GIT on a Solaris system that seems to
> > > have a total lack of GNU utilities.
> > 
> > Two points.
> > 
> >  - Aren't the constructs you ripped out not GCC extension,
> >    rather proper ISO C99?
> 
> Hmm.  I'm not sure actually.  I don't do much C hacking these days
> so I haven't kept current with what C99 has and doesn't.  I just
> know that these small changes made the core plumbing build and run
> fine on Solaris with only GNU make being present.  I didn't even
> attempt to use the higher level Poreclainish shell script commands.

Yes, that's valid C99. So Sun ships a compiler conforming to old
standards only, or which is configured to do so.

> Monday I'll look to see if there's an option that can be given to
> the Solaris compiler to make it accept these constructs.  Maybe a
> simple CFLAGS change in my config.mak would resolve what this patch
> was trying to do.

Thanks.

> >  - Our Makefile is pretty GNU already.  I think people have
> >    pointed out and ripped out bashisms from our shell scripts,
> >    but I would not be surprised if the default Sun /bin/sh does
> >    not understand POSIXy features some of them use.
> 
> I realize that.  Asking someone to compile GNU make in their home
> directory before they build GIT to their home directory isn't a
> big deal (took me all of 30 seconds to download the latest and
> ./configure&&make install it).  Asking someone to download and
> compile binutils and gcc because their local site manager won't
> install them for you is another matter entirely...

AFAIK, relying on the '#!/bin/sh' thing is, from the POSIX point of
view, just plain wrong. IIRC, the '#!' thing even doesn't need to be
implemented! POSIX tells you to call scripts with their interpreters,
for a reason. /bin/sh needn't be POSIX compliant, but the first shell
found in the $PATH has to. So for what it's worth, shell scripts
should be called like `sh foo.sh', and if we narrow to expect the `#!'
to work, we'd better call it like `#!/usr/bin/env sh' to get the $PATH
`sh' and not /bin/sh .

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-07-09  7:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-08 18:34 [PATCH] Remove more gcc extension usage Shawn Pearce
2006-07-08 18:51 ` Junio C Hamano
2006-07-08 19:03   ` Shawn Pearce
2006-07-09  7:31     ` Jan-Benedict Glaw [this message]
2006-07-10  5:22       ` Shawn Pearce
2006-07-10  6:14         ` Jan-Benedict Glaw
2006-07-10  6:22         ` Pavel Roskin
2006-07-10  6:25           ` Jan-Benedict Glaw
2006-07-10  6:52             ` Pavel Roskin
2006-07-10  7:35               ` Jan-Benedict Glaw
2006-07-10  8:07                 ` Pavel Roskin
2006-07-10  8:10                   ` Junio C Hamano
2006-07-10  8:18                   ` Jan-Benedict Glaw
2006-07-10  7:47           ` Junio C Hamano
2006-07-12 13:46         ` Paul Jakma

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=20060709073155.GP22573@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=spearce@spearce.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).