Changeset 641707d


Ignore:
Timestamp:
Jan 31, 2025, 1:52:18 PM (4 weeks ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
bbbff10
Parents:
372d33c
Message:

More fixing of warnings. Including another error that slipped through to the build and the rest of the 'easy' fixes on tests not in a directory.

Files:
12 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified libcfa/src/collections/vector.hfa

    r372d33c r641707d  
    9797static inline void reserve(vector(T, allocator_t)* this, size_t size)
    9898{
    99         realloc_storage(&this->storage, this->size+1);
     99        realloc_storage(&this->storage, size);
    100100}
    101101
  • TabularUnified tests/.expect/attributes.x86.txt

    r372d33c r641707d  
    11771177    __attribute__ ((unused)) signed int **const _X10_retval_f2KPPi_1;
    11781178    {
    1179         ((void)((*((signed int ***)(&_X10_retval_f2KPPi_1)))=((void*)((unsigned long int )0))) /* ?{} */);
     1179        ((void)((*((signed int ***)(&_X10_retval_f2KPPi_1)))=((void*)((unsigned int )0))) /* ?{} */);
    11801180    }
    11811181
     
    11911191
    11921192    {
    1193         ((void)(_X10_retval_f5PA0i_1=((void*)((unsigned long int )0))) /* ?{} */);
     1193        ((void)(_X10_retval_f5PA0i_1=((void*)((unsigned int )0))) /* ?{} */);
    11941194    }
    11951195
     
    12031203
    12041204    {
    1205         ((void)(_X10_retval_f6PA0i_1=((void*)((unsigned long int )0))) /* ?{} */);
     1205        ((void)(_X10_retval_f6PA0i_1=((void*)((unsigned int )0))) /* ?{} */);
    12061206    }
    12071207
     
    12121212    __attribute__ ((unused)) signed int (*_X10_retval_f8Fi_i__1)(signed int __param_0);
    12131213    {
    1214         ((void)(_X10_retval_f8Fi_i__1=((void*)((unsigned long int )0))) /* ?{} */);
     1214        ((void)(_X10_retval_f8Fi_i__1=((void*)((unsigned int )0))) /* ?{} */);
    12151215    }
    12161216
     
    12201220    __attribute__ ((unused)) signed int (*_X10_retval_f9Fi_i__1)(signed int __param_0);
    12211221    {
    1222         ((void)(_X10_retval_f9Fi_i__1=((void*)((unsigned long int )0))) /* ?{} */);
     1222        ((void)(_X10_retval_f9Fi_i__1=((void*)((unsigned int )0))) /* ?{} */);
    12231223    }
    12241224
     
    12281228    __attribute__ ((unused)) signed int (*_X11_retval_f10Fi_i__1)(signed int __param_0);
    12291229    {
    1230         ((void)(_X11_retval_f10Fi_i__1=((void*)((unsigned long int )0))) /* ?{} */);
     1230        ((void)(_X11_retval_f10Fi_i__1=((void*)((unsigned int )0))) /* ?{} */);
    12311231    }
    12321232
  • TabularUnified tests/Makefile.am

    r372d33c r641707d  
    109109        io/manipulatorsInput-uchunk \
    110110        io/many_read \
    111         math \
    112         minmax \
    113         operators \
    114         poly-many-arsz \
    115         polymorphism \
    116111        raii/ctor-autogen \
    117112        raii/dtor-early-exit \
    118113        raii/init_once \
    119114        references \
    120         shortCircuit \
    121         sum \
    122         switch \
    123115        tuple/tupleCast \
    124         tuple/tupleMember \
    125         userLiterals \
    126         vector
     116        tuple/tupleMember
    127117
    128118WFLAGS=${if ${filter ${WFLGAS_OPT_LAX},${@}},${WFLAGS_LAX},${WFLAGS_STRICT}}
  • TabularUnified tests/math.cfa

    r372d33c r641707d  
    5555
    5656        struct S { int i; };
    57         double ?*?( double d, S s ) { return d * s.i; }
    58         double ?/?( double d, S s ) { return d / s.i; }
    5957        S ?\?( S s, unsigned long y ) { return (S){ s.i \ y }; }
    6058        ofstream & ?|?( ofstream & os, S s ) { return os | s.i; }
  • TabularUnified tests/minmax.cfa

    r372d33c r641707d  
    1818
    1919int main( void ) {
    20         // char does not have less or greater than.
    21         int ?<?( char op1, char op2 ) { return (int)op1 < (int)op2; }
    22         int ?>?( char op1, char op2 ) { return (int)op1 > (int)op2; }
    23 
    2420        sout | "char\t\t\t"                                     | 'z' | ' ' | 'a' | "\tmin " | min( 'z', 'a' );
    2521        sout | "signed int\t\t"                         | 4 | -3 | "\tmin" | min( 4, -3 );
  • TabularUnified tests/operators.cfa

    r372d33c r641707d  
    1 int ?*?( int a, int b ) {
     1int ?*?( int, int ) {
    22        return 0;
    33}
     
    77}
    88
    9 int ?+?( int a, int b ) {
     9int ?+?( int, int ) {
    1010        return 0;
    1111}
    1212
    13 int ?=?( int &a, int b ) {
     13int ?=?( int &, int ) {
    1414        return 0;
    1515}
     
    1818};
    1919
    20 char ?()( struct accumulator a, char number1, char number2 ) {
     20char ?()( struct accumulator, char, char ) {
    2121        return 'a';
    2222}
    2323
    2424void f( void ) {
    25         char a, b;
     25        char a = 0, b = 0;
    2626        ?()( a, b );
    2727        a(b);
     
    2929}
    3030
    31 int main(int argc, char const *argv[]) {
     31int main() {
    3232        /* code */
    3333        printf( "done\n" );                             // non-empty .expect file
  • TabularUnified tests/poly-many-arsz.cfa

    r372d33c r641707d  
    2929
    3030    mypair(char[2], char) y @= {};
    31     printf("|y| = %ld\n", sizeof(y));    // 3
     31    printf("|y| = %zd\n", sizeof(y));    // 3
    3232
    3333    y.second = 0;
     
    4343    // adding this declaration of x ...
    4444    mypair(char[1], char) x @= {};
    45     printf("|x| = %ld\n", sizeof(x));    // 2
     45    printf("|x| = %zd\n", sizeof(x));    // 2
     46
     47    // ... even if it isn't really used ...
     48    (void)x;
    4649
    4750    // ... must not affect the observed facts of y:
    4851
    4952    mypair(char[2], char) y @= {};
    50     printf("|y| = %ld\n", sizeof(y));    // 3
     53    printf("|y| = %zd\n", sizeof(y));    // 3
    5154
    5255    y.second = 0;
  • TabularUnified tests/polymorphism.cfa

    r372d33c r641707d  
    2929
    3030forall( T, U )
    31 size_t struct_size( T i, U j ) {
     31size_t struct_size( T, U ) {
    3232        struct S { T i; U j; };
    3333        return sizeof(S);
     
    3535
    3636forall( T, U )
    37 size_t union_size( T i, U j ) {
     37size_t union_size( T, U ) {
    3838        union B { T i; U j; };
    3939        return sizeof(B);
     
    4242// perform some simple operations on aggregates of T and U
    4343forall( T | { void print(T); int ?==?(T, T); }, U | { void print(U); U ?=?(U&, zero_t); } )
    44 U foo(T i, U j) {
     44U foo(T i, U) {
    4545        struct S { T i; U j; };
    4646        union B { T i; U j; };
     
    6868                double & x_inner_double = x; \
    6969                float  & x_inner_float  = x; \
    70                 printf("  offset of inner double: %ld\n", ((char *) & x_inner_double) - ((char *) & x) ); \
    71                 printf("  offset of inner float:  %ld\n", ((char *) & x_inner_float ) - ((char *) & x) );
     70                printf("  offset of inner double: %zd\n", ((char *) & x_inner_double) - ((char *) & x) ); \
     71                printf("  offset of inner float:  %zd\n", ((char *) & x_inner_float ) - ((char *) & x) );
    7272
    7373        void showStatic( thing(long long int) & x ) {
  • TabularUnified tests/shortCircuit.cfa

    r372d33c r641707d  
    11//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    3 // 
     3//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
    7 // shortCircuit.cfa -- 
    8 // 
     6//
     7// shortCircuit.cfa --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Jan 28 18:26:16 2016
     
    1212// Last Modified On : Tue Dec  4 18:26:05 2018
    1313// Update Count     : 4
    14 // 
     14//
    1515
    16 void g( float f ) {}
    17 void g( int i ) {}
     16void g( float ) {}
     17void g( int ) {}
    1818
    1919void f( int a ) {
    20         int b;
    21         float c;
     20        int b = 0;
     21        float c = 0;
    2222        g( a ? b : c );
    2323        g( a && c );
     
    2626
    2727void g() {
    28         int a;
    29         struct { int b; } a;
     28        int a = 1;
     29        struct Int { int b; } a = { 0 };
    3030        if ( a ) {
    3131                while ( a ) {
     
    3535                }
    3636        }
     37        // This should never be resolved to.
     38        (void)(Int)a;
    3739}
    3840
     
    4345};
    4446
    45 int ?!=?( test_t lhs, int rhs ) {
     47int ?!=?( test_t lhs, zero_t ) {
    4648        sout | lhs.x | " ";
    4749        return lhs.x != 0;
    4850}
    4951
    50 int main( int argc, char const *argv[] ) {
     52int main() {
    5153        sout | nlOff;
    5254        test_t true_val, false_val;
  • TabularUnified tests/sum.cfa

    r372d33c r641707d  
    8787        struct S { int i, j; };
    8888        void ?{}( S & s ) { s.[i, j] = 0; }
    89         void ?{}( S & s, int i ) { s.[i, j] = [i, 0]; }
    9089        void ?{}( S & s, int i, int j ) { s.[i, j] = [i, j]; }
    9190        void ?{}( S & s, zero_t ) { s.[i, j] = 0; }
  • TabularUnified tests/switch.cfa

    r372d33c r641707d  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // switch.cfa -- 
     7// switch.cfa --
    88//
    99// Author           : Peter A. Buhr
     
    1212// Last Modified On : Fri Jan 17 14:10:12 2025
    1313// Update Count     : 45
    14 // 
     14//
    1515
    1616int f( int i ) { return i; }
     
    5757          default:
    5858                i = 3;
     59                s = (S){ -7 };
     60                fallthrough;
    5961          case 19:
    6062          case 'A' ... 'Z':
     
    6365                j = 3;
    6466                f( 3 );
     67                k = 5;
    6568                break;
    6669        } // switch
     
    9295                i = 3;
    9396                f( 3 );
     97                s = (S){ -7 };
    9498          default:
    9599                j = 3;
     
    98102                fallthrough;
    99103          case 'd':
    100                 j = 5;
     104                k = 5;
    101105        } // choose
    102106
  • TabularUnified tests/userLiterals.cfa

    r372d33c r641707d  
    1515
    1616#include <fstream.hfa>
     17#include <uchar.h>
     18
     19// Warning triggered by the standard header, we can't fix that.
     20#pragma GCC diagnostic push
     21#pragma GCC diagnostic ignored "-Wtype-limits"
    1722#include <wchar.h>
    18 #include <uchar.h>
     23#pragma GCC diagnostic pop
    1924
    2025int ?`s( int s ) { sout | "secs" | s; return s; }
Note: See TracChangeset for help on using the changeset viewer.