tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] pp bug


From: grischka
Subject: Re: [Tinycc-devel] pp bug
Date: Sat, 09 May 2015 15:07:57 +0200
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Pip Cet wrote:
I'm still working on this, for what it's worth. I'm not quite there
yet, but here's the current diff, and a few more CPP tests. Right now
it shouldn't be too hard to break the new code, but if you just happen
to do so please let me know how so I can put it on my list.

Hi,
I've managed to fix some of the issues, partially based on old
patches of mine, partially on your ideas/researches:
http://repo.or.cz/w/tinycc.git/commitdiff/30df3189b177c65d65094bed3a066a2722fe2dc0

VA_ARGS is as before though (i.e. seems to work but not if
you try to trick it.).  Also no "auto" spaces (which I think
tinycc can live without).

Below the current state of test with your bug## files:

Thanks,

--- gtischka

lmake: Entering directory 'tests/cpp2'
PPTest bug01 ...
PPTest bug04 ...
PPTest bug05 ...
PPTest bug06 ...
--- bug06.gcc.txt       Sat May  9 10:08:34 2015
+++ bug06.out.txt       Sat May  9 13:04:44 2015
@@ -1,10 +1,10 @@
 f(a,)
 f(a,)
 f(a,)
-f(a,)
+f(a)
 f(a)
 f(a,)
 f(a,)
 f(a,)
-f(a,)
+f(a)
 f(a)
------------ bug06.c -------------
#define t(x) x
#define T
#define S T
#define A(x,y...) f(x,##y)
#define B(x,...) f(x, ##__VA_ARGS__)

A(a,t())
A(a,T)
A(a,S)
A(a,)
A(a)


B(a,t())
B(a,T)
B(a,S)
B(a,)
B(a)
------------ bug06.c -------------
PPTest bug07 ...
PPTest bug14 ...
--- bug14.gcc.txt       Fri May  8 14:34:54 2015
+++ bug14.out.txt       Sat May  9 13:04:45 2015
@@ -1,6 +1,6 @@
 int main(void)
 {
   printf("%s\n", "");
-  printf("%s\n", "g(a,,) g(a,b,b) g(a,b,c,b,c)");
+  printf("%s\n", "g(a) g(a,b,b) g(a,b,c,b,c)");
   printf("%s\n", "");
 }
------------ bug14.c -------------
#define A(a,b...) g(a,##b,##b)
#define B(x...) x
#define C   \


#define STRINGIFY2(x) #x
#define STRINGIFY(x) STRINGIFY2(x)

int main(void)
{
  printf("%s\n", STRINGIFY(C));

  printf("%s\n", STRINGIFY(
                           A(a,)
                           A(a,b)
                           A(a,b,c)
                           ));
  printf("%s\n", STRINGIFY(B()));
}
------------ bug14.c -------------
PPTest bug15 ...
PPTest bug17 ...
PPTest bug18 ...
PPTest bug19 ...
PPTest bug20 ...
PPTest bug21 ...
PPTest bug22 ...
PPTest bug24 ...
PPTest bug25 ...
PPTest bug26 ...
PPTest bug27 ...
PPTest bug30 ...
--- bug30.gcc.txt       Sat May  9 10:23:51 2015
+++ bug30.out.txt       Sat May  9 13:04:46 2015
@@ -1,4 +1,4 @@
 str1(1 + x ## y + 2)
-"1 + x ## y + 2"
+"1 + x y + 2"
 str1((1 + x * y + 2))
-"(1 + x * y + 2)"
+"1 + xy + 2"
------------ bug30.c -------------
#define str(s) #s
#define str2(s) str(s)

#define x 1 + x
#define y y + 2
#define xy (x * y)

#define xxx x ## y

str1(x ## y)
str2(x ## y)
str1(xxx)
str2(xxx)
------------ bug30.c -------------
PPTest bug33 ...
PPTest bug34 ...
--- bug34.gcc.txt       Fri May  8 14:34:56 2015
+++ bug34.out.txt       Sat May  9 13:04:46 2015
@@ -1,2 +1,2 @@
-extern const char acpi_gbl_ns_properties[0x1E +1];
+extern const char acpi_gbl_ns_properties[0x1E+1];
 int main() { return 0; }
------------ bug34.c -------------
#define ACPI_TYPE_INVALID   0x1E
#define NUM_NS_TYPES        ACPI_TYPE_INVALID+1
extern const char acpi_gbl_ns_properties[NUM_NS_TYPES];
int main() { return 0; }
------------ bug34.c -------------
PPTest bug35 ...
--- bug35.gcc.txt       Fri May  8 14:34:56 2015
+++ bug35.out.txt       Sat May  9 13:04:46 2015
@@ -1,3 +1,3 @@
-extern const char acpi_gbl_ns_properties[++1 ++b];
-int main() { int i; i + + + =; return 0; }
+extern const char acpi_gbl_ns_properties[++1++b];
+int main() { int i; i +++=; return 0; }
 include "++1++b"
------------ bug35.c -------------
#define STRINGIFY2(x) #x
#define STRINGIFY(x) STRINGIFY2(x)
#define ACPI_TYPE_INVALID()   ++1
#define PLUS() +
#define EQUALS() =
#define NUM_NS_TYPES        ACPI_TYPE_INVALID()++b

#define STR # NUM_NS_TYPES
#define PLUSPLUS() PLUS()PLUS()PLUS()EQUALS()
extern const char acpi_gbl_ns_properties[NUM_NS_TYPES];
int main() { int i; i PLUSPLUS(); return 0; }
include STRINGIFY(NUM_NS_TYPES)
------------ bug35.c -------------
PPTest bug36 ...
PPTest bug37 ...
PPTest bug38 ...
--- bug38.gcc.txt       Fri May  8 14:34:56 2015
+++ bug38.out.txt       Sat May  9 13:04:47 2015
@@ -1 +1 @@
-/ *
+/*
------------ bug38.c -------------
#define STRINGIFY2(x) #x
#define STRINGIFY(x) STRINGIFY2(x)
#define SLASH() /
#define STAR() *
SLASH()STAR()
------------ bug38.c -------------
PPTest bug39 ...
PPTest bug40 ...
PPTest bug41 ...
PPTest bug43 ...
PPTest bug44 ...
PPTest bug45 ...
PPTest bug46 ...
PPTest bug47 ...
PPTest bug48 ...
PPTest bug49 ...
PPTest bug50 ...
PPTest bug51 ...
--- bug51.gcc.txt       Fri May  8 14:34:58 2015
+++ bug51.out.txt       Sat May  9 13:04:48 2015
@@ -1 +1 @@
-(1,ONEMORE(1))
+(1,(1,1))
------------ bug51.c -------------
#define ONEMORE(args...) (1,##args)

ONEMORE(ONEMORE(1))
------------ bug51.c -------------
PPTest bug52 ...
--- bug52.gcc.txt       Sat May  9 10:10:44 2015
+++ bug52.out.txt       Sat May  9 13:04:48 2015
@@ -1 +0,0 @@
-
------------ bug52.c -------------
#define X(...)
#define Y(x) x
Y(X X() ())

------------ bug52.c -------------
PPTest bug53 ...
PPTest bug54 ...
PPTest bug55 ...
PPTest bug56 ...
PPTest bug57 ...
PPTest bug58 ...
PPTest bug60 ...
PPTest bug61 ...
PPTest bug62 ...
PPTest test01 ...
PPTest test02 ...
--- test02.gcc.txt      Fri May  8 14:34:59 2015
+++ test02.out.txt      Sat May  9 13:04:49 2015
@@ -1,4 +1,4 @@
 f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
-f(2 * (2 +(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
+f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
 int i[] = { 1, 23, 4, 5, };
 char c[2][6] = { "hello", "" };
------------ test02.c -------------
#define x 3
#define f(a) f(x * (a))
#undef x
#define x 2
#define g f
#define z z[0]
#define h g(~
#define m(a) a(w)
#define w 0,1
#define t(a) a
#define p() int
#define q(x) x
#define r(x,y) x ## y
#define str(x) # x
f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
g(x+(3,4)-w) | h 5) & m
(f)^m(m);
p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) };
char c[2][6] = { str(hello), str() };
/*
 * f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
 * f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);
 * int i[] = { 1, 23, 4, 5, };
 * char c[2][6] = { "hello", "" };
 */
------------ test02.c -------------
PPTest test03 ...
PPTest test04 ...
PPTest test05 ...
PPTest test06 ...
PPTest test07 ...
PPTest test08 ...
PPTest test09 ...
PPTest test10 ...
PPTest test11 ...
PPTest test12 ...
PPTest test13 ...
lmake: Leaving directory 'tests/cpp2'
-->(0)



reply via email to

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