| Last change
 on this file since 5a894e12 was             10b5970, checked in by Michael Brooks <mlbrooks@…>, 10 months ago | 
        
          | 
Fix many test-suite- and libcfa-caused unused variable warnings.
 
In scope are easy fixes among tests whose sole warnings were unused variable.  Reduces the wflags lax list by 40%.
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            867 bytes | 
      
      
| Line |  | 
|---|
| 1 | //Testing enum declaration | 
|---|
| 2 | enum Colours { | 
|---|
| 3 | Red, | 
|---|
| 4 | Yellow, | 
|---|
| 5 | Pink, | 
|---|
| 6 | Blue, | 
|---|
| 7 | Purple, | 
|---|
| 8 | Orange, | 
|---|
| 9 | Green | 
|---|
| 10 | }; | 
|---|
| 11 |  | 
|---|
| 12 | enum Colours c1; | 
|---|
| 13 | Colours c2; | 
|---|
| 14 |  | 
|---|
| 15 | void f( void ) { | 
|---|
| 16 | enum Fruits { | 
|---|
| 17 | Apple, | 
|---|
| 18 | Banana, | 
|---|
| 19 | Pear, | 
|---|
| 20 | Mango | 
|---|
| 21 | } fruit = Mango;        (void) fruit; | 
|---|
| 22 | enum Fruits f1;         (void) f1; | 
|---|
| 23 | Fruits f2;                      (void) f2; | 
|---|
| 24 | } | 
|---|
| 25 |  | 
|---|
| 26 | // test constant-expressions | 
|---|
| 27 |  | 
|---|
| 28 | struct S { | 
|---|
| 29 | int i; | 
|---|
| 30 | }; | 
|---|
| 31 | enum K { P = 3 + 4 }; | 
|---|
| 32 | enum Y { W = 9 + (3 && 4 || 7)}; | 
|---|
| 33 | int p[W]; | 
|---|
| 34 | enum { X = W + -3 + ~1 / 2 * (int)4 + sizeof(struct S) + _Alignof(struct S) || 3 && 5 + (3 ? 1 : 2 ) + __builtin_offsetof(struct S, i ) }; | 
|---|
| 35 | int x[X]; | 
|---|
| 36 | enum { B = 3 + 4 - 7 * 20 / 34 << 3 >> 4 > 8 < 9 <= 23 >= 42 == 12 != 13  & 4 ^ 2 | 8 + sizeof(struct S) + _Alignof(struct S) }; | 
|---|
| 37 | int y[B]; | 
|---|
| 38 | enum { J = +3 + -4 / ~20 * ! 0 }; | 
|---|
| 39 | int z[J] = { 1, 2, 3 }; | 
|---|
| 40 | int aa[41] @= { [3] = 3, [1] = 6 }; | 
|---|
| 41 |  | 
|---|
| 42 | //Dummy main | 
|---|
| 43 | int main() { | 
|---|
| 44 | printf( "done\n" );                             // non-empty .expect file | 
|---|
| 45 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.