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

Re: [PATCH 5/6] Fix some "comparison is always true/false" warnings.

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Mar 7, 2007, 19:05 UTC
Message-ID
<45EF0D0D.4060904@ramsay1.demon.co.uk>
In-Reply-To
<20070305074502.GA31507@diana.vm.bytemark.co.uk>
Karl Hasselström wrote:
Show 6 quoted lines
> On 2007-03-03 18:28:57 +0000, Ramsay Jones wrote:
> 
>> +typedef unsigned int ucs_char_t;  /* assuming 32bit int */
> 
> Umm ... wouldn't an uint32_t be a better fit here?
> 

Yes, but I did not want to add a dependency on a C99 header (i.e. <stdint.h>). I had a vague recollection that Linus had stated that git was probably broken if int wasn't 32 bits, so ...

This was before I realized that a recent change to git meant that git was already including C99 headers <inttypes.h> and, therefore indirectly, <stdint.h>.

So, if it is OK to depend on those headers, then an uin32_t may indeed be a better fit.

All the best,
Ramsay Jones
Previous: Karl HasselströmNext: Karl Hasselström
Message 3 of 4 in “Fix some "comparison is always true/false" warnings.”
  1. 5/6 Fix some "comparison is always true/false" warnings.Ramsay Jones, Mar 3, 2007
  2. Karl HasselströmMar 5, 2007
  3. Ramsay JonesMar 7, 2007
  4. Karl HasselströmMar 8, 2007

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.