tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Tidying TCC's external API


From: Jean-Claude Beaudoin
Subject: Re: [Tinycc-devel] Tidying TCC's external API
Date: Mon, 26 Sep 2016 03:22:12 -0400



On Mon, Sep 26, 2016 at 2:59 AM, Christian JULLIEN <address@hidden> wrote:
> I gather that this is for the case where ONE_SOURCE is "not" set, and under a "configure --disable-static" such that tcc is linked againsta libtcc.dll. Am I right?

Right!

Well that seems to be only part of the problem. Trying to compile on Windows XP
with MinGW I just came to the conclusion that the Makefile content I also largely to blame.
What compiler are you using to compile tcc?
 

I've no precise idea why tcc.c requires pstrcpy:
$ grep strcpy tcc.c
            pstrcpy(child_path, sizeof child_path - 40, argv[0]);
            strcpy(child_name, target);
        pstrcpy(buf, sizeof(buf), target);
        pstrcpy(ext, sizeof(buf) - (ext-buf), ".d");
    pstrcpy(buf, sizeof(buf), name);
        strcpy(ext, ".dll");
        strcpy(ext, ".exe");
        strcpy(ext, ".o");
        strcpy(buf, "a.out");

I see it uses both pstrcpy and strcpy.

At first sight it looks pretty arbitrary! There may be some reason but it sure
does not jump out to a casual reader.
Anyway, tcc.c contains some ONE_SOURCE conditionals that should make
this whole question disappear if ONE_SOURCE was propagated properly in the 
Makefile which is not the case right now.
Working on it...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]