Skip to content
Failed

Changes

formatting
pabuhr at
Strengthen a test that had been evading warnings on 64-bit only.

This test change is expected to break the 64-bit build (to match currently-broken 32-bit).  A subsequet test change is expected to fix both builds.

This change makes a test, which was incorrectly architecture-specific, into one that is architecture-independent.

Test is: array-collections/c_dependent.

The relevant array-size warning occurs in gcc-11+ (new-gcc).

The test had been passing on 64-bit only because of a quirk: new-gcc's dependent warning gives false accept when a dimension expression is complex enough; CFA's (arch-specific) inserted casts interacted with an incidental choice of the test program, as follows:

// original
void f__bound_ptr_allow( int n, float a[n] ); // source
void f__bound_ptr_allow( int n, float a[(unsigned long int) n] ); // 64-bit lowering => different enough type, check skipped
void f__bound_ptr_allow( int n, float a[(unsigned int) n] ); // 32-bit lowering => close enough type, check enforced

// this change's revision
void f__bound_ptr_allow( size_t n, float a[n] ); // source
void f__bound_ptr_allow( unsigned long int n, float a[(unsigned long int) n] ); // 64-bit lowering => close enough type, check enforced
void f__bound_ptr_allow( unsigned int n, float a[(unsigned int) n] ); // 32-bit lowering => close enough type, check enforced
mlbrooks at