From ad7f76f5a50a4892a6d5ada46338edbb3ab80d9b Mon Sep 17 00:00:00 2001 From: Nathan R Date: Tue, 10 Aug 2021 16:52:34 +0200 Subject: [PATCH] added comments to know where the test should break --- tests-err/test14.c | 6 +++--- tests-err/test15.c | 14 +++++++------- tests-err/test23.c | 7 +++---- tests-err/test26.c | 3 +-- tests-err/test41.c | 6 ++---- tests-err/test43.c | 2 +- tests-err/test45.c | 4 ++-- tests-err/test5.c | 6 +++--- tests-err/test57.c | 2 +- tests-err/test66.c | 5 ++--- 10 files changed, 25 insertions(+), 30 deletions(-) diff --git a/tests-err/test14.c b/tests-err/test14.c index 109c7a3..10cbc74 100644 --- a/tests-err/test14.c +++ b/tests-err/test14.c @@ -1,7 +1,7 @@ main() { int a; - typedef b = (a); + typedef b = (a); // typedef ‘b’ is initialized (use __typeof__ instead) typeof (int *) c; - typeof (d[0](1)) e; + typeof (d[0](1)) e; // ‘d’ undeclared (first use in this function) c = &a; -} +} \ No newline at end of file diff --git a/tests-err/test15.c b/tests-err/test15.c index 9e3c551..3a395cb 100644 --- a/tests-err/test15.c +++ b/tests-err/test15.c @@ -1,20 +1,20 @@ //generalized lvalues foo() { int a,b,f; - (a, b) += 5; - a, (b += 5); - &(a, b); + (a, b) += 5; // lvalue required as left operand of assignment + a, (b += 5); + &(a, b); // lvalue required as unary ‘&’ operand a, &b; - (a ? b : c) = 5 ; + (a ? b : c) = 5 ; // ‘c’ undeclared (first use in this function) (a ? b = 5 : (c = 5)) ; - (int)a = 5 ; + (int)a = 5 ; // lvalue required as left operand of assignment (int)(a = (char *)(int)5) ; - (int)a += 5; + (int)a += 5; // lvalue required as left operand of assignment (int)(a = (char *)(int) ((int)a + 5)); - (int)f = 1; + (int)f = 1; // lvalue required as left operand of assignment (int *)&f; } diff --git a/tests-err/test23.c b/tests-err/test23.c index 3ba9207..049919f 100644 --- a/tests-err/test23.c +++ b/tests-err/test23.c @@ -4,9 +4,8 @@ now() { double y; void hack (union foo); union foo u; - u = (union foo) x == u.i = x; - u = (union foo) y == u.d = y; + u = (union foo) x == u.i = x; // invalid operands to binary == (have ‘union foo’ and ‘int’) + u = (union foo) y == u.d = y; // invalid operands to binary == (have ‘union foo’ and 'double') hack ((union foo) x); -} - +} diff --git a/tests-err/test26.c b/tests-err/test26.c index 133f235..e04ad23 100644 --- a/tests-err/test26.c +++ b/tests-err/test26.c @@ -1,6 +1,5 @@ func (x, y) { - int x, y; + int x, y; // ‘x’ redeclared as different kind of symbol / ‘y’ redeclared as different kind of symbol return x+y; } - diff --git a/tests-err/test41.c b/tests-err/test41.c index b1d8636..dc4bde9 100644 --- a/tests-err/test41.c +++ b/tests-err/test41.c @@ -8,7 +8,5 @@ switch (x) { break; case 2: y=90; break; - default: -} -} - + default: // label at end of compound statement +} \ No newline at end of file diff --git a/tests-err/test43.c b/tests-err/test43.c index d2a941f..3083c34 100644 --- a/tests-err/test43.c +++ b/tests-err/test43.c @@ -8,7 +8,7 @@ goto l66;; } else { y=100; y++; -l66: +l66: // label at end of compound statement } } diff --git a/tests-err/test45.c b/tests-err/test45.c index 552a58d..b2790ac 100644 --- a/tests-err/test45.c +++ b/tests-err/test45.c @@ -6,7 +6,7 @@ void gg (h765t *q23w3) { if (q23w3->ll881ss[3]) { if (1) { - q23w3->ll881ss[3] = (void *) (++(int)q23w3->ll881ss[3]); + q23w3->ll881ss[3] = (void *) (++(int)q23w3->ll881ss[3]); // lvalue required as increment operand } } -} +} \ No newline at end of file diff --git a/tests-err/test5.c b/tests-err/test5.c index 7ff8fd6..287f06a 100644 --- a/tests-err/test5.c +++ b/tests-err/test5.c @@ -12,7 +12,7 @@ PyMapping_SetItemString(o, key, value) if( ! key) return Py_ReturnNullError(),-1; if (!(okey=PyString_FromString(key))) return -1; r = PyObject_SetItem(o,okey,value); - if (--( okey )->ob_refcnt != 0) ; else (*( okey )->ob_type->tp_dealloc)((PyObject *)( okey )) ; + if (--( okey )->ob_refcnt != 0) ; else (*( okey )->ob_type->tp_dealloc)((PyObject *)( okey )) ; // (1)request for member ‘ob_refcnt’ in something not a structure or union / (2)request for member ‘ob_type’ in something not a structure or union + // ^(1) ^(2) return r; -} - +} \ No newline at end of file diff --git a/tests-err/test57.c b/tests-err/test57.c index 7195919..62bdd16 100644 --- a/tests-err/test57.c +++ b/tests-err/test57.c @@ -1,6 +1,6 @@ void F(char l) { - return l<= '\~'; + return l<= '\~'; // ‘return’ with a value, in function returning void / unknown escape sequence: '\~' } diff --git a/tests-err/test66.c b/tests-err/test66.c index e4a9469..b9ccdd8 100644 --- a/tests-err/test66.c +++ b/tests-err/test66.c @@ -1,4 +1,3 @@ f (__builtin_va_alist ) - int __builtin_va_alist;... -{ } - + int __builtin_va_alist;... // expected declaration specifiers before ‘...’ token +{ } // expected ‘{’ at end of input