tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Predefined macro identifying TinyC?


From: Martin Guy
Subject: [Tinycc-devel] Predefined macro identifying TinyC?
Date: Mon, 16 Mar 2015 11:50:06 +0100

Hi

I wondered if there is a predefined TinyC macro to tell that TinyC is
the compiler in use.
I've looked through the documentation and "strings"-ed the binary but
can't see anything.

The reason is to work round what looks like a bug in the 64-bit
pointer handling, which is
fairly easy to workaround:

/* Tickle a bug in TinyC on 64-bit systems:
 * the LSB of the top word or ARGP gets set
 * for no obvious reason.
 *
 * Source: a legacy language interpreter which
 * has a little stack / stack pointer for arguments.
 *
 * Output is: 0x8049620 0x10804961c
 * Should be: 0x8049620 0x804961c
 */

#define NARGS 20000
int ARG[NARGS];
int *ARGSPACE = ARG;
int *ARGP = ARG - 1;

main()
{
  printf("%p %p\n", ARGSPACE, ARGP);
}

Thanks for keeping tcc alive and well. Your work is appreciated

    M



reply via email to

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