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 mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to