Git development
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Dan McMahill <dmcmahill@NetBSD.org>
Subject: Re: [PATCH] diff: "S_IFREG | 0644" to "(S_IFREG | 0644)" to avoid warning
Date: Mon, 4 Oct 2010 04:35:19 -0500	[thread overview]
Message-ID: <20101004093519.GN24884@burratino> (raw)
In-Reply-To: <1286184071-28457-1-git-send-email-avarab@gmail.com>

Ævar Arnfjörð Bjarmason wrote:

> -	unsigned mode = canon_mode(S_IFREG | 0644);
> +	unsigned mode = canon_mode((S_IFREG | 0644));

Just curious:

#define canon_mode(mode) \
        (S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \
        S_ISLNK(mode) ? S_IFLNK : S_ISDIR(mode) ? S_IFDIR : S_IFGITLINK)

#define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)

Since S_ISREG et al are macros, typically they would put their
argument in parentheses in the definition.  How are they defined
in NetBSD sys/stat.h?  What is canon_mode(S_IFREG | 0644) being
misinterpreted to mean?

  reply	other threads:[~2010-10-04  9:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04  9:21 [PATCH] diff: "S_IFREG | 0644" to "(S_IFREG | 0644)" to avoid warning Ævar Arnfjörð Bjarmason
2010-10-04  9:35 ` Jonathan Nieder [this message]
2010-10-04  9:47   ` Ævar Arnfjörð Bjarmason
2010-10-04 17:54     ` Junio C Hamano
2010-10-04 18:10       ` [PATCH v2] cache.h: work around broken NetBSD system headers Ævar Arnfjörð Bjarmason
2010-10-04  9:42 ` [PATCH] diff: "S_IFREG | 0644" to "(S_IFREG | 0644)" to avoid warning Ævar Arnfjörð Bjarmason
2010-10-04 10:35   ` Jonathan Nieder
2010-10-04 10:50     ` Jonathan Nieder
2010-10-04 10:53 ` René Scharfe
2010-10-04 11:45   ` Matthieu Moy
2010-10-04 19:23   ` Junio C Hamano
2010-10-04 21:11     ` René Scharfe
2010-10-04 12:28 ` yj2133011

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=20101004093519.GN24884@burratino \
    --to=jrnieder@gmail.com \
    --cc=avarab@gmail.com \
    --cc=dmcmahill@NetBSD.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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