git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] diff: "S_IFREG | 0644" to "(S_IFREG | 0644)" to avoid warning

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Oct 4, 2010, 09:42 UTC
Message-ID
<AANLkTim+QH6=XJikOsZs=qt9ZFHjP7gWz0zo9n4vz+gk@mail.gmail.com>
In-Reply-To
<1286184071-28457-1-git-send-email-avarab@gmail.com>
On Mon, Oct 4, 2010 at 09:21, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 6 quoted lines
> Wrap "S_IFREG | 0644" in parentheses to avoid a "suggest parentheses
> around arithmetic in operand of |" warning from GCC 4.1.3 on NetBSD
> 5.0.2.
>
> I spotted and fixed this independently on NetBSD, but later found that
> there was a NetBSD Problem Report that included this fix.

With this and Jonathan's xdiff patch git compiles without warnings on NetBSD, aside from this:

    imap-send.c: In function 'ssl_socket_connect':
    imap-send.c:310: warning: assignment discards qualifiers from
pointer target type
    imap-send.c:312: warning: assignment discards qualifiers from
pointer target type

I don't see a sane way around that[1], since it appears the NetBSD people have patched openssl's function definitions without bumping the OpenSSL version number. Either that or OpenSSL itself changed from const char* to char* to const char* again, I didn't investigate that.

But tests on NetBSD with /bin/sh still fail since we use cd -P, but we have unapplied patches for that so I didn't pursue it:

    http://article.gmane.org/gmane.comp.version-control.git/136561/match=
    http://article.gmane.org/gmane.comp.version-control.git/136562/match=
1. We could check for __NetBSD__ and the NetBSD version, but it's not
   worthwhile for a single warning.
Previous: Ævar Arnfjörð BjarmasonNext: Jonathan Nieder
Message 6 of 13 in “diff: "S_IFREG | 0644" to "(S_IFREG | 0644)" to avoid warning”
  1. diff: "S_IFREG | 0644" to "(S_IFREG | 0644)" to avoid warningÆvar Arnfjörð Bjarmason, Oct 4, 2010
  2. Jonathan NiederOct 4, 2010
  3. Ævar Arnfjörð BjarmasonOct 4, 2010
  4. Junio C HamanoOct 4, 2010
  5. cache.h: work around broken NetBSD system headersÆvar Arnfjörð Bjarmason, Oct 4, 2010
  6. Ævar Arnfjörð BjarmasonOct 4, 2010
  7. Jonathan NiederOct 4, 2010
  8. Jonathan NiederOct 4, 2010
  9. René ScharfeOct 4, 2010
  10. Matthieu MoyOct 4, 2010
  11. Junio C HamanoOct 4, 2010
  12. René ScharfeOct 4, 2010
  13. yj2133011Oct 4, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.