[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm
From: |
Michael Matz |
Subject: |
Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm |
Date: |
Sat, 29 Mar 2014 18:53:14 +0100 (CET) |
User-agent: |
Alpine 2.00 (LNX 1167 2008-08-23) |
Hello,
On Fri, 28 Mar 2014, Domingo Alvarez Duarte wrote:
I found that on X86_64 linux if I do not free the memory on __va_end(), the
compiled fossil-scm server works, I suspect is something with the
fork/threads.---
void __va_end(struct __va_list_struct *ap)
{
//free(ap);
}
Cheers !
Errr. I see you now fiddled with that on mob. Commit c025478d7c03,
rewriting va* to not use malloc. That's completely wrong. You've
effectively changed the ABI of stdarg, and hence interoperability with
every non-TCC compiler. The public va_list on x86_64 _must_ be a pointer.
To see it breaking try e.g. this:
% cat vatest.c
#include <stdio.h>
#include <stdarg.h>
static int passdown (const char *str, va_list ap)
{
int ret;
va_list ap2;
va_copy (ap2, ap);
ret = vprintf (str, ap2);
va_end (ap2);
return ret;
}
static int myprintf (const char *str, ...)
{
va_list ap;
va_start (ap, str);
passdown (str, ap);
va_end (ap);
}
int main ()
{
myprintf ("%s %i %f\n", "bla", 42, 0.4);
return 0;
}
When executed it must print:
bla 42 0.400000
Before your patch it does, after your patch it prints garbage (on my
system " 134514261 0.000000") (without the va_copy and ap2 it even just
segfaults now, though strictly speaking that's invalid stdarg usage).
Please revert.
If you could please _discuss_ changes in parts you don't completely
understand on the list before making nilly-willy changes? Just because
fossil-scm "works" after your patching doesn't mean much if you don't know
_why_ fossil-scm didn't work before, and especially doesn't mean that the
change was even correct.
Ciao,
Michael.
- [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Domingo Alvarez Duarte, 2014/03/27
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Domingo Alvarez Duarte, 2014/03/27
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Domingo Alvarez Duarte, 2014/03/27
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Domingo Alvarez Duarte, 2014/03/28
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Domingo Alvarez Duarte, 2014/03/28
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm,
Michael Matz <=
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Domingo Alvarez Duarte, 2014/03/29
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Domingo Alvarez Duarte, 2014/03/29
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Domingo Alvarez Duarte, 2014/03/29
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Michael Matz, 2014/03/29
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Domingo Alvarez Duarte, 2014/03/30
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Daniel Glöckner, 2014/03/30
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Michael Matz, 2014/03/29
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Daniel Glöckner, 2014/03/29
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Daniel Glöckner, 2014/03/29
- Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm, Daniel Glöckner, 2014/03/29