[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
- [Tinycc-devel] Predefined macro identifying TinyC?,
Martin Guy <=
- Re: [Tinycc-devel] Predefined macro identifying TinyC?, Edmund Grimley Evans, 2015/03/16
- Re: [Tinycc-devel] Predefined macro identifying TinyC?, Ben Bacarisse, 2015/03/16
- Re: [Tinycc-devel] Predefined macro identifying TinyC?, Ramsay Jones, 2015/03/16
- Re: [Tinycc-devel] Predefined macro identifying TinyC?, Martin Guy, 2015/03/16
- Re: [Tinycc-devel] Predefined macro identifying TinyC?, Sergey Korshunoff, 2015/03/19
- Re: [Tinycc-devel] Predefined macro identifying TinyC?, Sergey Korshunoff, 2015/03/20
- Re: [Tinycc-devel] Predefined macro identifying TinyC?, Sergey Korshunoff, 2015/03/23
- Re: [Tinycc-devel] Predefined macro identifying TinyC?, Martin Guy, 2015/03/23