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

Re: Git compile warnings (under mac/clang)

From
Peter Wu <peter@lekensteyn.nl>
Date
Jan 22, 2015, 21:19 UTC
Message-ID
<8235317.pb98ayo4Kl@al>
In-Reply-To
<CAGZ79kaFWL5HWdctLzTWf6D4nTP19sPZbcOg9fiRx7RQrWjY7Q@mail.gmail.com>
On Thursday 22 January 2015 11:59:54 Stefan Beller wrote:
Show 43 quoted lines
> cc Johannes Schindelin <Johannes.Schindelin@gmx.de> who is working in
> the fsck at the moment
> cc Peter Wu <peter@lekensteyn.nl> who worked on builtin/remote.c a few weeks ago
> 
> I just compiled origin/pu to test and also found a problem (doesn't
> happen in origin/master):
> 
> http.c: In function 'get_preferred_languages':
> http.c:1020:2: warning: implicit declaration of function 'setlocale'
> [-Wimplicit-function-declaration]
>   retval = setlocale(LC_MESSAGES, NULL);
>   ^
> http.c:1020:21: error: 'LC_MESSAGES' undeclared (first use in this function)
>   retval = setlocale(LC_MESSAGES, NULL);
>                      ^
> http.c:1020:21: note: each undeclared identifier is reported only once
> for each function it appears in
> 
> so I cc Yi EungJun <eungjun.yi@navercorp.com> as well.
> 
> On Thu, Jan 22, 2015 at 11:43 AM, Michael Blume <blume.mike@gmail.com> wrote:
> > These are probably minor, I only bring them up because Git's build is
> > generally so quiet that it might be worth squashing these too.
> >
> >     CC fsck.o
> > fsck.c:110:38: warning: comparison of unsigned enum expression >= 0 is
> > always true [-Wtautological-compare]
> >         if (options->msg_severity && msg_id >= 0 && msg_id < FSCK_MSG_MAX)
> >                                      ~~~~~~ ^  ~
> > 1 warning generated.
> >     AR libgit.a
> > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
> > file: libgit.a(gettext.o) has no symbols
> >     CC builtin/remote.o
> > builtin/remote.c:1572:5: warning: add explicit braces to avoid
> > dangling else [-Wdangling-else]
> >                                 else
> >                                 ^
> > builtin/remote.c:1580:5: warning: add explicit braces to avoid
> > dangling else [-Wdangling-else]
> >                                 else
> >                                 ^
> > 2 warnings generated.

Hi, these warnings were present in v3 of the git-remote patch. v4 was proposed to overcome these issues, but I have yet to respond to Junio's feedback at http://www.spinics.net/lists/git/msg243652.html (Message-ID: <xmqqr3vx9ad5.fsf@gitster.dls.corp.google.com>)

(cc'ing Junio to let him know I am still alive :p)
I'll get back to this next week, had some other tasks to prepare for.

Kind regards, Peter

> > (the warning about libgit.a(gettext.o) is probably because I'm
> > building with NO_GETTEXT -- I've never been able to get gettext to
> > work on my mac)
Previous: Stefan BellerNext: Johannes Schindelin
Message 3 of 15 in “Git compile warnings (under mac/clang)”
  1. Michael BlumeJan 22, 2015
  2. Stefan BellerJan 22, 2015
  3. Peter WuJan 22, 2015
  4. Johannes SchindelinJan 22, 2015
  5. Jeff KingJan 22, 2015
  6. Johannes SchindelinJan 23, 2015
  7. Jeff KingJan 23, 2015
  8. Johannes SchindelinJan 23, 2015
  9. Jeff KingJan 23, 2015
  10. Junio C HamanoJan 23, 2015
  11. Jeff KingJan 23, 2015
  12. Johannes SchindelinJan 23, 2015
  13. Jeff KingJan 23, 2015
  14. Johannes SchindelinJan 23, 2015
  15. Junio C HamanoJan 23, 2015

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.