[Top][All Lists]

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

Re: [Tinycc-devel] pp bug

From: Pip Cet
Subject: Re: [Tinycc-devel] pp bug
Date: Sat, 2 May 2015 22:10:46 +0000

Yes, sorry, I accidentally committed changes that were still being
tested. Is the current mob branch okay?

What is happening here is that we generate the correct token stream,
but fail to take into account that numbers and such cannot be printed
without intervening spaces. PARSE_FLAG_TOK_NUM doesn't matter, really.

also consider:

#define SLASH() /
#define STAR() *
SLASH()STAR() code

It's probably quite hard to fix this without making the preprocessor a
little slower (a simple "fix" is:

@@ -3347,7 +3389,9 @@ print_line:
             if (!token_seen)
+        fputs(" ", s1->ppfp);
         fputs(get_tok_str(tok, &tokc), s1->ppfp);

but that makes preprocessed output basically unreadable. It seems GCC
has a table of tokens that can be concatenated safely.)

On Sat, May 2, 2015 at 9:12 PM, Sergey Korshunoff <address@hidden> wrote:
> Hi!
> A test program:
> #define ACPI_TYPE_INVALID   0x1E
> extern const char acpi_gbl_ns_properties[NUM_NS_TYPES];
> int main() { return 0; }
> tcc -E test.c -o test.i
> tcc -c test.i
> Some of the last tcc have problems with this.
> extern const char acpi_gbl_ns_properties[0x1E +1]; // gcc
> extern const char acpi_gbl_ns_properties[0x1E+1]; // tcc
> Strange, but there is no problem with the same test if
> tcc -c test.c
> (w/o preprocessor step)
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel

reply via email to

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