git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jan Engelhardt <jengelh@inai.de>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] daemon: restore getpeername(0,...) use
Date: Mon, 10 Sep 2012 10:21:00 -0400	[thread overview]
Message-ID: <20120910142100.GB7906@sigill.intra.peff.net> (raw)
In-Reply-To: <alpine.LNX.2.01.1209082119320.18369@frira.zrqbmnf.qr>

On Sat, Sep 08, 2012 at 09:20:48PM +0200, Jan Engelhardt wrote:

> On Saturday 2012-09-08 20:59, Junio C Hamano wrote:
> >> diff --git a/daemon.c b/daemon.c
> >> index 4602b46..eaf08c2 100644
> >> --- a/daemon.c
> >> +++ b/daemon.c
> >> @@ -1,3 +1,4 @@
> >> +#include <stdbool.h>
> >>  #include "cache.h"
> >>  #include "pkt-line.h"
> >>  #include "exec_cmd.h"
> >
> >Platform agnostic parts of the code that use "git-compat-util.h"
> >(users of "cache.h" are indirectly users of it) are not allowed to
> >do platform specific include like this at their beginning.
> >
> >This is the first use of stdbool.h; what do you need it for?
> 
> For the use in setenv(,,true). It was not entirely obvious in which .h 
> to add it; the most reasonable place was daemon.c itself, since the 
> other .c files do not seem to need it.

It would go in git-compat-util.h. However, it really is not needed; you
can simply pass "1" to setenv, as every other callsite in git does.

More importantly, though, is it actually portable? I thought it was
added in C99, and we try to stick to C89 to support older compilers and
systems. My copy of C99 is vague (it says only that the "bool" macro was
added via stdbool.h in C99, but nothing about the "true" and "false"
macros), and I don't have a copy of C89 handy.  Wikipedia does claim the
header wasn't standardized at all until C99:

  https://en.wikipedia.org/wiki/C_standard_library

-Peff

  reply	other threads:[~2012-09-10 14:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-08 17:09 Restore hostname logging in inetd mode Jan Engelhardt
2012-09-08 17:09 ` [PATCH] daemon: restore getpeername(0,...) use Jan Engelhardt
2012-09-08 17:57   ` Joachim Schmitz
2012-09-08 19:03     ` Junio C Hamano
2012-09-08 19:20       ` Joachim Schmitz
2012-09-08 18:59   ` Junio C Hamano
2012-09-08 19:20     ` Jan Engelhardt
2012-09-10 14:21       ` Jeff King [this message]
2012-09-10 14:38         ` Joachim Schmitz
2012-09-10 15:50           ` Jeff King
2012-09-10 17:26             ` Joachim Schmitz
2012-09-10 17:58               ` Jeff King
2012-09-10 18:27                 ` Joachim Schmitz
2012-09-10 20:15                   ` Jeff King
2012-09-08 18:57 ` Restore hostname logging in inetd mode Junio C Hamano
2012-09-08 19:18   ` Jan Engelhardt

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=20120910142100.GB7906@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jengelh@inai.de \
    /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).