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

Re: Git compile warnings (under mac/clang)

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 22, 2015, 21:20 UTC
Message-ID
<b2cbad0d8e59a0c4eb0565608f3f90bc@www.dscho.org>
In-Reply-To
<CAGZ79kaFWL5HWdctLzTWf6D4nTP19sPZbcOg9fiRx7RQrWjY7Q@mail.gmail.com>
Hi Stefan,
On 2015-01-22 20:59, Stefan Beller wrote:
Show 10 quoted lines
> cc Johannes Schindelin <Johannes.Schindelin@gmx.de> who is working in
> the fsck at the moment
>
> On Thu, Jan 22, 2015 at 11:43 AM, Michael Blume <blume.mike@gmail.com> wrote:
>
>>     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)
>>                                      ~~~~~~ ^  ~
According to A2.5.4 of The C Programming Language 2nd edition:
    Identifiers declared as enumerators (see Par.A.8.4) are constants of type int.
Therefore, the warning is incorrect: any assumption about enum fsck_msg_id to be unsigned is false.

Ciao, Johannes

Previous: Peter WuNext: Jeff King
Message 4 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.