Hello,

On Sat, 30 May 2020, Patrick Hammer wrote:

Hi!

The second program also works with Clang, gcc etc., but not with tcc.
It tries to use stringification with a backslash, indirectly:

#include <stdio.h>
#define PRINT_(X) puts(#X);
#define PRINT(X) PRINT_(X)

int main(void)
{
    PRINT(\\)
    return 0;
}

Here the workaround is to use no indirection, to use PRINT_(\\) instead of
PRINT(\\) or to change the definition of PRINT to #define PRINT(X) puts(#X),
in which case the program prints the backslash as expected. However this
isn't a good workaround, as avoiding indirections in the macros can
sometimes be very annoying, luckily it worked in my program though.

Thanks for the report! The error message about backslashes was emitted too early. Fixed in mob.


Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to