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

Re: git-rebase (1.5.0.6) errors

From
JHJan Hudec <bulb@ucw.cz>
Date
May 20, 2007, 12:43 UTC
Message-ID
<20070520124345.GB27087@efreet.light.src>
In-Reply-To
<Pine.LNX.4.64.0705181640270.14736@kivilampi-30.cs.helsinki.fi>
On Fri, May 18, 2007 at 17:02:56 +0300, Ilpo Järvinen wrote:
Show 8 quoted lines
> David Kastrup <dak@gnu.org> wrote:
> 
> > Only if size_t is a larger type than int (could be on x86-64 and alpha
> > architectures).  Other than that, this comparison would work.  Which
> > does not mean that this does not warrant fixing, but it is not
> > necessarily the cause of this problem.
> 
> ...sizeof(size_t) == sizeof(int) should hold...
Really?
$ cat test.c
#include <stdio.h>
int main(void)
{
    printf("sizeof(int) = %i\n", sizeof(int));
    printf("sizeof(long) = %i\n", sizeof(long));
    printf("sizeof(size_t) = %i\n", sizeof(size_t));
    return 0;
}
$ gcc -otest test.c
$ ./test
sizeof(int) = 4
sizeof(long) = 8
sizeof(size_t) = 8
Hm, it does not seem that sizeof(size_t) == sizeof(int).

$ uname -m x86_64

Yes, this is a 64-bit system.
Anyway, comparing it with -1 is ALWAYS OK in spite of this!
$ cat test2.c
#include <stdio.h>
int main(void)
{
    size_t x = 0;
    --x;
    printf("x = 0x%lx\n", x);
    printf("(x == -1) = %i\n", (x == -1));
    return 0;
}
$ gcc -otest2 test2.c
$ ./test2
x = 0xffffffffffffffff
(x == -1) = 1

So at least with gcc that comparison is OK anyway. There has to be something else that causes that problem.

Show 10 quoted lines
> Anyway, if this has any relevance: I'm using non-utf system, and (as you 
> see) my surname has ä... The system was recently upgraded to git 1.5+ 
> which started to complain also about a missing i18n.commitencoding, 
> figured out that when I set it to utf8 (empty => defaults to it) and have 
> signed-off line (with native non-utf ä), I get that error...
> 
> ...and please, do not drop me from cc since I'm not subscribed...
> 
> -- 
>  i.
-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: Paolo TetiNext: Ilpo Järvinen
Message 7 of 9 in “git-rebase (1.5.0.6) errors”
  1. Ilpo JärvinenMay 18, 2007
  2. Paolo TetiMay 18, 2007
  3. David KastrupMay 18, 2007
  4. Paolo TetiMay 18, 2007
  5. Ilpo JärvinenMay 18, 2007
  6. Paolo TetiMay 18, 2007
  7. Jan HudecMay 20, 2007
  8. Ilpo JärvinenMay 20, 2007
  9. Paolo TetiMay 18, 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.