Changeset 10b5970


Ignore:
Timestamp:
Jan 7, 2025, 3:22:19 PM (9 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
190a833
Parents:
70670e7
Message:

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%.

Files:
62 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/queue.hfa

    r70670e7 r10b5970  
    3333                }
    3434
    35                 T * succ( Queue(T) & q, T * n ) with( q ) {             // pre: *n in *q
    36                         #ifdef __CFA_DEBUG__
     35                T * succ( Queue(T) & q, T * n ) {                                       // pre: *n in *q
     36                  #ifdef __CFA_DEBUG__
    3737                        if ( ! listed( n ) ) abort( "(Queue &)%p.succ( %p ) : Node is not on a list.", &q, n );
    38                         #endif // __CFA_DEBUG__
     38                  #else
     39                        (void) q;
     40                  #endif // __CFA_DEBUG__
    3941                        return (Next( n ) == n) ? 0p : Next( n );
    4042                } // post: n == tail() & succ(n) == 0 | n != tail() & *succ(n) in *q
  • libcfa/src/concurrency/mutex_stmt.hfa

    r70670e7 r10b5970  
    3030forall(L & | is_lock(L)) {
    3131    static inline void * __get_mutexstmt_lock_ptr( L & this ) { return &this; }
    32     static inline L __get_mutexstmt_lock_type( L & this ) {}
    33     static inline L __get_mutexstmt_lock_type( L * this ) {}
     32    static inline L __get_mutexstmt_lock_type( L & ) {}
     33    static inline L __get_mutexstmt_lock_type( L * ) {}
    3434}
  • tests/Makefile.am

    r70670e7 r10b5970  
    6161# Tests that need investigation from the CFA team about why they require lax wflags.  Goal is to eliminate this list.
    6262WFLGAS_OPT_LAX_TO_INVESTIGATE = \
    63         alloc \
    6463        attributes \
    6564        collections/atomic_mpsc \
    66         collections/multi_list \
    6765        collections/queue \
    6866        collections/sequence \
     
    7876        concurrency/actors/static \
    7977        concurrency/actors/types \
    80         concurrency/barrier/generation \
    81         concurrency/barrier/last \
    82         concurrency/barrier/order \
    8378        concurrency/channels/big_elems \
    8479        concurrency/channels/churn \
     
    8984        concurrency/channels/pub_sub \
    9085        concurrency/channels/zero_size \
    91         concurrency/cluster \
    9286        concurrency/cofor \
    93         concurrency/coroutineYield \
    94         concurrency/examples/boundedBufferEXT \
    95         concurrency/examples/boundedBufferINT \
    9687        concurrency/futures/multi \
    9788        concurrency/futures/select_future \
    9889        concurrency/futures/typed \
    9990        concurrency/futures/wait_any \
    100         concurrency/join \
    10191        concurrency/lockfree_stack \
    102         concurrency/migrate \
    103         concurrency/monitor \
    104         concurrency/multi-monitor \
    10592        concurrency/mutexstmt/locks \
    106         concurrency/mutexstmt/monitors \
    10793        concurrency/mutexstmt/tuple \
    10894        concurrency/once \
    109         concurrency/preempt \
    11095        concurrency/pthread/bounded_buffer \
    11196        concurrency/pthread/pthread_attr_test \
    112         concurrency/pthread/pthread_cond_test \
    11397        concurrency/pthread/pthread_demo_create_join \
    11498        concurrency/pthread/pthread_demo_lock \
    11599        concurrency/pthread/pthread_key_test \
    116100        concurrency/pthread/pthread_once_test \
    117         concurrency/readyQ/leader_spin \
    118         concurrency/signal/block \
    119         concurrency/signal/disjoint \
    120         concurrency/signal/wait \
    121         concurrency/sleep \
    122         concurrency/suspend_then \
    123101        concurrency/thread \
    124102        concurrency/unified_locking/block_spin_lock \
     
    134112        concurrency/unified_locking/spin_queue_lock \
    135113        concurrency/unified_locking/timeout_lock \
    136         concurrency/waitfor/barge \
    137         concurrency/waitfor/statment \
    138         concurrency/waitfor/when \
    139114        concurrency/waituntil/all_types \
    140115        concurrency/waituntil/basic_else \
     
    147122        concurrency/waituntil/repeat_close \
    148123        concurrency/waituntil/timeout \
    149         configs/parsebools \
    150         configs/parsenums \
    151124        configs/usage \
    152         coroutine/raii \
    153         ctrl-flow/goto \
    154         ctrl-flow/ifwhileCtl \
    155125        ctrl-flow/labelledExit \
    156126        ctrl-flow/loop_else \
    157127        designations \
    158         enum \
    159         enum_tests/inc-dec \
    160         enum_tests/planet \
    161         enum_tests/structEnum \
    162128        exceptions/cardgame \
    163129        exceptions/defaults \
    164130        exceptions/defaults-threads \
    165         exceptions/hotpotato \
    166         exceptions/hotpotato_checked \
    167         exceptions/pingpong_nonlocal \
    168131        exceptions/polymorphic \
    169132        exceptions/try-leave-catch \
     
    181144        io/comp_basic \
    182145        io/comp_fair \
    183         io/io-acquire \
    184         io/io-acquire2 \
    185         io/io-acquire-in \
    186         io/io-acquire-no-io \
    187         io/io-acquire-out \
    188146        io/manipulatorsInput \
    189147        io/manipulatorsInput-uchunk \
    190148        io/many_read \
    191         linking/io-acquire \
    192         linking/mangling/anon \
    193                 linking/mangling/lib.o \
    194                 linking/mangling/main.o \
    195         linkonce \
    196                 link-once/% \
    197         malloc \
    198149        math \
    199         mathX \
    200         maybe \
    201150        minmax \
    202151        operators \
    203         poly-d-cycle \
    204152        poly-many-arsz \
    205         poly-member \
    206153        polymorphism \
    207154        poly-o-cycle \
    208         PRNG \
    209         quotedKeyword \
    210155        raii/boxed-types \
    211156        raii/ctor-autogen \
    212157        raii/dtor-early-exit \
    213158        raii/init_once \
    214         raii/partial \
    215159        references \
    216         result \
    217160        shortCircuit \
    218         sizeof \
    219161        smart-pointers \
    220162        sum \
    221163        switch \
    222         tuple/tupleAssign \
    223164        tuple/tupleCast \
    224165        tuple/tupleMember \
    225         tuple/tuplePolymorphism \
    226         tuple/tupleVariadic \
    227         typeof \
    228166        userLiterals \
    229167        vector
  • tests/PRNG.cfa

    r70670e7 r10b5970  
    8686
    8787thread T3 {};
    88 void main( T3 & th ) {
     88void main( T3 & ) {
    8989        size_t * buckets = calloc( BUCKETS );                           // too big for task stack
    9090        for ( TRIALS / 5 ) {
  • tests/alloc.cfa

    r70670e7 r10b5970  
    2121#include <stdlib.hfa>                                                                   // access C malloc, realloc
    2222
    23 int * foo( int * p, int c ) { return p; }
    24 int * bar( int * p, int c ) { return p; }
    25 int * baz( int * p, int c ) { return p; }
     23int * foo( int * p, int ) { return p; }
     24int * bar( int * p, int ) { return p; }
     25int * baz( int * p, int ) { return p; }
    2626
    2727int main( void ) {
     
    217217                const_count++;
    218218        }
    219         void ^?{}( Struct & a ) { dest_count++; }                       // destruct
     219        void ^?{}( Struct & ) { dest_count++; }                 // destruct
    220220        Struct st, st1, sta[dim], sta1[dim], * stp, * stp1;
    221221
  • tests/concurrency/channels/ping_pong.cfa

    r70670e7 r10b5970  
    1616
    1717thread Pong {};
    18 void main(Pong & this) {
     18void main(Pong &) {
    1919    try {
    2020        for ( ;; ) {
     
    2727
    2828thread Ping {};
    29 void main(Ping & this) {
     29void main(Ping &) {
    3030    try {
    3131        for ( ;; ) {
     
    3939
    4040
    41 int main( int argc, char * argv[] ) {
     41int main() {
    4242    sout | "start";
    4343    processor proc[1];
  • tests/concurrency/cluster.cfa

    r70670e7 r10b5970  
    99}
    1010
    11 void main( MyThread & this ) {
     11void main( MyThread & ) {
    1212        for(50) {
    1313                yield();
  • tests/concurrency/coroutineYield.cfa

    r70670e7 r10b5970  
    2424coroutine Coroutine {};
    2525
    26 void main(Coroutine& this) {
     26void main( Coroutine & ) {
    2727        while(true) {
    2828                #if !defined(TEST_FOREVER)
     
    3939
    4040Coroutine c;
    41 int main(int argc, char* argv[]) {
     41int main() {
    4242        for(int i = 0; TEST(i < N); i++) {
    4343                #if !defined(TEST_FOREVER)
  • tests/concurrency/examples/boundedBufferEXT.cfa

    r70670e7 r10b5970  
    9494        Buffer(int) buffer;
    9595        int sums[Cons];
    96         int i;
    9796        processor p;
    9897
  • tests/concurrency/examples/boundedBufferINT.cfa

    r70670e7 r10b5970  
    9494        Consumer * cons[Cons];
    9595        int sums[Cons];
    96         int i;
    9796        processor p;
    9897
  • tests/concurrency/futures/wait_any.cfa

    r70670e7 r10b5970  
    3232
    3333thread Waiter {};
    34 void main( Waiter & this ) {
     34void main( Waiter & ) {
    3535    for (numtimes) {
    3636        wait_any(futures, num_futures);
     
    4242
    4343thread Deliverer {};
    44 void main( Deliverer & this ) {
     44void main( Deliverer & ) {
    4545    while (!done) {
    4646        size_t num_satisfy = random(1,num_futures);
  • tests/concurrency/join.cfa

    r70670e7 r10b5970  
    2828
    2929
    30 int main(int argc, char* argv[]) {
     30int main() {
    3131        {
    3232                Worker workers[17];
  • tests/concurrency/migrate.cfa

    r70670e7 r10b5970  
    4747        }
    4848
    49         struct cluster_wrapper * curr = (struct cluster_wrapper *)&the_clusters[0];
    50 
    5149        for(100) {
    5250                unsigned idx = prng( this, cluster_cnt );
  • tests/concurrency/monitor.cfa

    r70670e7 r10b5970  
    2828thread MyThread {};
    2929
    30 void main( MyThread & this ) {
     30void main( MyThread & ) {
    3131        for(int i = 0; i < 750_000; i++) {
    3232                increment( global );
     
    3434}
    3535
    36 int main(int argc, char* argv[]) {
     36int main() {
    3737        assert( global.__mon.entry_queue.tail != NULL );
    3838        processor p;
  • tests/concurrency/multi-monitor.cfa

    r70670e7 r10b5970  
    4444}
    4545
    46 int main(int argc, char* argv[]) {
     46int main() {
    4747        processor p;
    4848        {
  • tests/concurrency/mutexstmt/locks.cfa

    r70670e7 r10b5970  
    1212int count = 0;
    1313
    14 void main( T_Mutex & this ) {
     14void main( T_Mutex & ) {
    1515        for (unsigned int i = 0; i < num_times; i++) {
    1616                mutex ( m1 ) count++;
     
    3535thread T_Multi {};
    3636
    37 void main( T_Multi & this ) {
     37void main( T_Multi & ) {
    3838        for (unsigned int i = 0; i < num_times; i++) {
    3939                refTest( m1 );
     
    8181thread T_Multi_Poly {};
    8282
    83 void main( T_Multi_Poly & this ) {
     83void main( T_Multi_Poly & ) {
    8484        for (unsigned int i = 0; i < num_times; i++) {
    8585                refTest( l1 );
  • tests/concurrency/mutexstmt/monitors.cfa

    r70670e7 r10b5970  
    1616bool startFlag = false;
    1717
    18 void main( T_Mutex & this ) {
     18void main( T_Mutex & ) {
    1919        for (unsigned int i = 0; i < num_times; i++) {
    2020                mutex ( m1 ) count++;
     
    3030thread T_Multi {};
    3131
    32 void main( T_Multi & this ) {
     32void main( T_Multi & ) {
    3333        for (unsigned int i = 0; i < num_times; i++) {
    3434                mutex ( m1 ) {
  • tests/concurrency/preempt.cfa

    r70670e7 r10b5970  
    7171}
    7272
    73 int main(int argc, char* argv[]) {
     73int main() {
    7474        processor p;
    7575        globals.counter = 0;
  • tests/concurrency/pthread/pthread_cond_test.cfa

    r70670e7 r10b5970  
    99pthread_cond_t cond;
    1010
    11 extern "C"{
    12     void* S1(void* arg){
     11extern "C" {
     12    void* S1( void * ) {
    1313        pthread_mutex_lock(&_mutex);
    1414        for (int i = 0; i < 1000; i++) sout | "S1 done " | i;
     
    1919    }
    2020
    21     void* S2(void* arg){
     21    void* S2( void * ) {
    2222        pthread_mutex_lock(&_mutex);
    2323        if (!done_flag) pthread_cond_wait(&cond, &_mutex);
     
    3030
    3131
    32 int main(int argc, char const *argv[])
    33 {
    34     /* code */
     32int main() {
    3533    pthread_mutex_init(&_mutex, NULL);
    3634    pthread_cond_init(&cond, NULL);
  • tests/concurrency/pthread/pthread_once_test.cfa

    r70670e7 r10b5970  
    9090
    9191
    92 int main(int argc, char const *argv[])
     92int main()
    9393{
    9494    test();
  • tests/concurrency/readyQ/leader_spin.cfa

    r70670e7 r10b5970  
    9797
    9898// ==================================================
    99 int main(int argc, char * argv[]) {
     99int main() {
    100100        lead_idx = 0;
    101101        leader = prng( lead_rng, nthreads );
  • tests/concurrency/signal/block.cfa

    r70670e7 r10b5970  
    5151
    5252//------------------------------------------------------------------------------
    53 void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i ) {
     53void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned ) {
    5454    wait( cond, (uintptr_t)active_thread() );
    5555
     
    6767
    6868thread Waiter {};
    69 void main( Waiter & this ) {
     69void main( Waiter & ) {
    7070        for( int i = 0; TEST(i < N); i++ ) {
    7171                wait_op( globalA, globalB, i );
     
    100100
    101101thread Signaller {};
    102 void main( Signaller & this ) {
     102void main( Signaller & ) {
    103103        while( !done ) {
    104104                signal_op( globalA, globalB );
     
    112112
    113113thread Barger {};
    114 void main( Barger & this ) {
     114void main( Barger & ) {
    115115        for( unsigned i = 0; !done; i++ ) {
    116116                //Choose some monitor to barge into with some irregular pattern
     
    123123//------------------------------------------------------------------------------
    124124
    125 int main(int argc, char* argv[]) {
     125int main() {
    126126        srandom( time( NULL ) );
    127127        done = false;
  • tests/concurrency/signal/disjoint.cfa

    r70670e7 r10b5970  
    6565}
    6666
    67 void main( Barger & this ) {
     67void main( Barger & ) {
    6868        while( !all_done ) {
    6969                barge( globals.data );
     
    9393}
    9494
    95 void main( Waiter & this ) {
     95void main( Waiter & ) {
    9696        while( wait( globals.mut, globals.data ) ) { KICK_WATCHDOG; yield(); }
    9797}
     
    122122}
    123123
    124 void main( Signaller & this ) {
     124void main( Signaller & ) {
    125125        while( !all_done ) {
    126126                logic( globals.mut );
     
    131131//------------------------------------------------------------------------------
    132132// Main loop
    133 int main(int argc, char* argv[]) {
     133int main() {
    134134        srandom( time( NULL ) );
    135135        all_done = false;
  • tests/concurrency/signal/wait.cfa

    r70670e7 r10b5970  
    6565//----------------------------------------------------------------------------------------------------
    6666// Signaler
    67 void main( Signaler & this ) {
     67void main( Signaler & ) {
    6868
    6969        while( waiter_left != 0 ) {
     
    9292//----------------------------------------------------------------------------------------------------
    9393// Waiter ABC
    94 void main( WaiterABC & this ) {
     94void main( WaiterABC & ) {
    9595        for( int i = 0; TEST(i < N); i++ ) {
    9696                wait( condABC, globalA, globalB, globalC );
     
    103103//----------------------------------------------------------------------------------------------------
    104104// Waiter AB
    105 void main( WaiterAB & this ) {
     105void main( WaiterAB & ) {
    106106        for( int i = 0; TEST(i < N); i++ ) {
    107107                wait( condAB , globalA, globalB );
     
    114114//----------------------------------------------------------------------------------------------------
    115115// Waiter AC
    116 void main( WaiterAC & this ) {
     116void main( WaiterAC & ) {
    117117        for( int i = 0; TEST(i < N); i++ ) {
    118118                wait( condAC , globalA, globalC );
     
    125125//----------------------------------------------------------------------------------------------------
    126126// Waiter BC
    127 void main( WaiterBC & this ) {
     127void main( WaiterBC & ) {
    128128        for( int i = 0; TEST(i < N); i++ ) {
    129129                wait( condBC , globalB, globalC );
     
    136136//----------------------------------------------------------------------------------------------------
    137137// Main
    138 int main(int argc, char* argv[]) {
     138int main() {
    139139        srandom( time( NULL ) );
    140140        waiter_left = 4;
  • tests/concurrency/suspend_then.cfa

    r70670e7 r10b5970  
    6464
    6565thread Thread {};
    66 void main(Thread & this) {
     66void main( Thread & ) {
    6767        Coroutine * mine = 0p;
    6868        while(!done) {
     
    7878
    7979
    80 int main(int argc, char* argv[]) {
     80int main() {
    8181        processor p[2];
    8282        Coroutine c;
  • tests/concurrency/thread.cfa

    r70670e7 r10b5970  
    2828
    2929
    30 int main(int argc, char* argv[]) {
     30int main() {
    3131        semaphore lock = { 0 };
    3232        sout | "User main begin";
  • tests/concurrency/unified_locking/locks.cfa

    r70670e7 r10b5970  
    2323thread T_C_M_WS1 {};
    2424
    25 void main( T_C_M_WS1 & this ) {
     25void main( T_C_M_WS1 & ) {
    2626        for (unsigned int i = 0; i < num_times; i++) {
    2727                lock(m);
     
    3737thread T_C_M_WB1 {};
    3838
    39 void main( T_C_M_WB1 & this ) {
     39void main( T_C_M_WB1 & ) {
    4040        for (unsigned int i = 0; i < num_times; i++) {
    4141                lock(m);
     
    5151thread T_C_S_WS1 {};
    5252
    53 void main( T_C_S_WS1 & this ) {
     53void main( T_C_S_WS1 & ) {
    5454        for (unsigned int i = 0; i < num_times; i++) {
    5555                lock(s);
     
    6565thread T_C_S_WB1 {};
    6666
    67 void main( T_C_S_WB1 & this ) {
     67void main( T_C_S_WB1 & ) {
    6868        for (unsigned int i = 0; i < num_times; i++) {
    6969                lock(s);
     
    7979thread T_C_L_WS1 {};
    8080
    81 void main( T_C_L_WS1 & this ) {
     81void main( T_C_L_WS1 & ) {
    8282        for (unsigned int i = 0; i < num_times; i++) {
    8383                lock(l);
     
    9393thread T_C_L_WB1 {};
    9494
    95 void main( T_C_L_WB1 & this ) {
     95void main( T_C_L_WB1 & ) {
    9696        for (unsigned int i = 0; i < num_times; i++) {
    9797                lock(l);
     
    107107thread T_F_C_F_WS1 {};
    108108
    109 void main( T_F_C_F_WS1 & this ) {
     109void main( T_F_C_F_WS1 & ) {
    110110        for (unsigned int i = 0; i < num_times; i++) {
    111111                lock(f);
     
    121121thread T_C_O_WS1 {};
    122122
    123 void main( T_C_O_WS1 & this ) {
     123void main( T_C_O_WS1 & ) {
    124124        for (unsigned int i = 0; i < num_times; i++) {
    125125                lock(o);
     
    135135thread T_C_O_WB1 {};
    136136
    137 void main( T_C_O_WB1 & this ) {
     137void main( T_C_O_WB1 & ) {
    138138        for (unsigned int i = 0; i < num_times; i++) {
    139139                lock(o);
     
    149149thread T_C_M_WS2 {};
    150150
    151 void main( T_C_M_WS2 & this ) {
     151void main( T_C_M_WS2 & ) {
    152152        for (unsigned int i = 0; i < num_times; i++) {
    153153                lock(m);
     
    167167thread T_C_O_WS2 {};
    168168
    169 void main( T_C_O_WS2 & this ) {
     169void main( T_C_O_WS2 & ) {
    170170        for (unsigned int i = 0; i < num_times; i++) {
    171171                lock(o);
     
    185185thread T_C_NLW {};
    186186
    187 void main( T_C_NLW & this ) {
     187void main( T_C_NLW & ) {
    188188        for (unsigned int i = 0; i < num_times; i++) {
    189189                wait(c_o);
     
    193193thread T_C_NLS {};
    194194
    195 void main( T_C_NLS & this ) {
     195void main( T_C_NLS & ) {
    196196        for (unsigned int i = 0; i < num_times; i++) {
    197197                while (empty(c_o)) { }
     
    202202thread T_C_S_WNF {};
    203203
    204 void main( T_C_S_WNF & this ) {
     204void main( T_C_S_WNF & ) {
    205205        for (unsigned int i = 0; i < num_times; i++) {
    206206                lock(s);
     
    219219thread T_C_NLWD {};
    220220
    221 void main( T_C_NLWD & this ) {
     221void main( T_C_NLWD & ) {
    222222        done = false;
    223223        for (unsigned int i = 0; i < num_times/5; i++) {
     
    230230thread T_C_WDS {};
    231231
    232 void main( T_C_WDS & this ) {
     232void main( T_C_WDS & ) {
    233233        for (unsigned int i = 0; i < num_times; i++) {
    234234                while (empty(c_s) && !done) { }
     
    241241thread T_C_LWD {};
    242242
    243 void main( T_C_LWD & this ) {
     243void main( T_C_LWD & ) {
    244244        done = false;
    245245        for (unsigned int i = 0; i < num_times/5; i++) {
     
    254254thread T_C_LWDS {};
    255255
    256 void main( T_C_LWDS & this ) {
     256void main( T_C_LWDS & ) {
    257257        for (unsigned int i = 0; i < num_times; i++) {
    258258                while (empty(c_s) && !done) { }
  • tests/concurrency/unified_locking/pthread_locks.cfa

    r70670e7 r10b5970  
    1818thread Wait_Signal_1 {};
    1919
    20 void main( Wait_Signal_1 & this ) {
     20void main( Wait_Signal_1 & ) {
    2121        for (unsigned int i = 0; i < num_times; i++) {
    2222                lock(l);
     
    3232thread Wait_3_Signal_3 {};
    3333
    34 void main( Wait_3_Signal_3 & this ) {
     34void main( Wait_3_Signal_3 & ) {
    3535        for (unsigned int i = 0; i < num_times; i++) {
    3636                lock(l);
     
    4848thread Rec_Lock_Wait_Signal_1 {};
    4949
    50 void main( Rec_Lock_Wait_Signal_1 & this ) {
     50void main( Rec_Lock_Wait_Signal_1 & ) {
    5151        for (unsigned int i = 0; i < num_times; i++) {
    5252                lock(l);
     
    6666thread Wait_Time_Signal_1 {};
    6767
    68 void main( Wait_Time_Signal_1 & this ) {
     68void main( Wait_Time_Signal_1 & ) {
    6969        for (unsigned int i = 0; i < num_times; i++) {
    7070                lock(l);
     
    7474                        timespec waitTime{0,1};
    7575                        bool woken = wait(c,l, t + waitTime);
     76                        (void) woken;
    7677                }else{
    7778                        notify_one(c);
  • tests/concurrency/waitfor/barge.cfa

    r70670e7 r10b5970  
    3030}
    3131
    32 void ^?{} ( global_t & mutex this ) {}
     32void ^?{} ( global_t & mutex ) {}
    3333
    3434global_t global;
     
    4040
    4141thread barger_t {};
    42 void main( barger_t & this ) {
     42void main( barger_t & ) {
    4343        yield();
    4444        while( barge( global ) ) { yield(random( 10 )); }
     
    5656
    5757thread caller_t {};
    58 void main( caller_t & this ) {
     58void main( caller_t & ) {
    5959        while( do_call(global) ) { yield(random( 10 )); }
    6060}
     
    7878
    7979thread waiter_t{};
    80 void main( waiter_t & this ) {
     80void main( waiter_t & ) {
    8181        do_wait(global);
    8282}
  • tests/concurrency/waitfor/statment.cfa

    r70670e7 r10b5970  
    8989}
    9090
    91 void main( caller & this ) {
     91void main( caller & ) {
    9292        int index = get_index( m );
    9393        while( !start ) yield();
     
    122122thread waiter{};
    123123
    124 void main( waiter & this ) {
     124void main( waiter & ) {
    125125        do_wait( m );
    126126}
  • tests/concurrency/waitfor/when.cfa

    r70670e7 r10b5970  
    3939
    4040thread caller_t{};
    41 void main( caller_t & this ) {
     41void main( caller_t & ) {
    4242        while( true ) {
    4343                rand_yield();
     
    7676
    7777thread arbiter_t{};
    78 void main( arbiter_t & this ) {
     78void main( arbiter_t & ) {
    7979        arbiter( global );
    8080}
  • tests/concurrency/waituntil/channel_zero_size.cfa

    r70670e7 r10b5970  
    99
    1010thread Server1 {};
    11 void main( Server1 & this ) {
     11void main( Server1 & ) {
    1212    long long int a, b, c, i = 0, myTotal = 0;
    1313    for( ;;i++ ) {
  • tests/concurrency/waituntil/one_chan.cfa

    r70670e7 r10b5970  
    99
    1010thread Server1 {};
    11 void main( Server1 & this ) {
     11void main( Server1 & ) {
    1212    long long int c, i = 0, myTotal = 0;
    1313    for( ;;i++ ) {
  • tests/configs/parsebools.cfa

    r70670e7 r10b5970  
    2222
    2323int main( int argc, char * argv[] ) {
    24         check_main(argv[0]);
     24        if ( argc == 0 ) abort( "Test requires a command-line argument" );
     25        check_main( argv[0] );
    2526
    2627        bool YN = false;
  • tests/configs/parsenums.cfa

    r70670e7 r10b5970  
    3535
    3636int main( int argc, char * argv[]) {
    37         check_main( argv[0]);
     37        if ( argc == 0 ) abort( "Test requires a command-line argument" );
     38        check_main( argv[0] );
    3839
    3940        int i = -3;
  • tests/coroutine/raii.cfa

    r70670e7 r10b5970  
    3232coroutine Cor {};
    3333
    34 void ?{}( Cor & this ) {
     34void ?{}( Cor & ) {
    3535        sout | "Coroutine Ctor";
    3636}
    3737
    38 void main( Cor & this ) {
     38void main( Cor & ) {
    3939        Raii raii = { "Coroutine" };
    4040        sout | "Before Suspend";
     
    4343}
    4444
    45 void ^?{}( Cor & this ) {
     45void ^?{}( Cor & ) {
    4646        sout | "Coroutine Dtor";
    4747}
  • tests/ctrl-flow/goto.cfa

    r70670e7 r10b5970  
    1616}
    1717
    18 int main(int argc, char * argv[]) {
     18int main() {
    1919        sout | nlOff;
    2020
  • tests/ctrl-flow/ifwhileCtl.cfa

    r70670e7 r10b5970  
    1919
    2020int main( void ) {
    21         int x = 4, y = 3;
     21        int x = 4, y = 3;               (void) x; (void) y;
    2222
    2323        if ( int x = 1 ) {
     
    4242
    4343        if ( struct S { int i; } s = { 3 }; s.i < 4 ) {
    44                 S s1;
     44                S s1;   (void) s1;
    4545                sout | "s.i < 4 correct";
    4646        } else {
    47                 S s1;
     47                S s1;   (void) s1;
    4848                sout | "s.i >= 4 incorrect";
    4949        } // if
     
    6464
    6565        while ( struct S { int i; } s = { 3 }; s.i < 4 ) {
    66                 S s1;
     66                S s1;   (void) s1;
    6767                sout | "s.i < 4 correct";
    6868                break;
  • tests/enum.cfa

    r70670e7 r10b5970  
    1919                Pear,
    2020                Mango
    21         } fruit = Mango;
    22         enum Fruits f1;
    23         Fruits f2;
     21        } fruit = Mango;        (void) fruit;
     22        enum Fruits f1;         (void) f1;
     23        Fruits f2;                      (void) f2;
    2424}
    2525
     
    4141
    4242//Dummy main
    43 int main(int argc, char const *argv[]) {
     43int main() {
    4444        printf( "done\n" );                             // non-empty .expect file
    4545}
  • tests/enum_tests/inc-dec.cfa

    r70670e7 r10b5970  
    44enum() Number { One, Two, Three };
    55
    6 int main(int argc, char * argv[]) {
     6int main() {
    77        Number a = One;
    88
  • tests/enum_tests/planet.cfa

    r70670e7 r10b5970  
    2828}
    2929
    30 int main( int argc, char * argv[] ) {
     30int main() {
    3131//      if ( argc != 2 ) exit | "Usage: " | argv[0] | "earth-weight"; // terminate program
    3232//      double earthWeight = convert( argv[1] );
  • tests/enum_tests/structEnum.cfa

    r70670e7 r10b5970  
    2626
    2727int main() {
    28      PointEnum vals = second;
    29      PointEnum val2;
     28     PointEnum vals = second;      (void) vals;
     29     PointEnum val2;               (void) val2;
    3030     // The failing line: assignment
    3131     // val2 = vals;
  • tests/exceptions/hotpotato.cfa

    r70670e7 r10b5970  
    129129        intmax_t seed = 42;                                                                     // random-number seed
    130130        bool playersSet = false;
    131         char * nosummary = getenv( "NOSUMMARY" );                       // print extra output
    132131
    133132        try {
  • tests/exceptions/hotpotato_checked.cfa

    r70670e7 r10b5970  
    150150        intmax_t seed = 42;                                                                     // random-number seed
    151151        bool playersSet = false;
    152         char * nosummary = getenv( "NOSUMMARY" );                       // print extra output
    153152
    154153        try {
  • tests/io/io-acquire-no-io.cfa

    r70670e7 r10b5970  
    5555        // above output used as input to parallel threads
    5656
    57         int a, b, c, d, e, f, g, h, i;
    5857        for ( 100 ) {                                                                           // expression protection
    5958                mutex(sinLock) doWork();
  • tests/link-once/main.cfa

    r70670e7 r10b5970  
    99}
    1010
    11 int main(int argc, char * argv[]) {
     11int main() {
    1212        printformat(example, example);
    1313}
  • tests/linking/mangling/main.cfa

    r70670e7 r10b5970  
    1212        a_typedefed_global.a_float = 9.0f;
    1313
     14        (void) test;
     15
    1416        sout | "Done!";
    1517}
  • tests/malloc.cfa

    r70670e7 r10b5970  
    5151        size_t elemSize = sizeof(int);
    5252        size_t size = dim * elemSize;
    53         char fill = '\xde';
    5453        int * ip;
    5554        T1 * tp;
  • tests/mathX.cfa

    r70670e7 r10b5970  
    2929        unsigned long long int ulli, ullir1, ullir2, ullir3;
    3030
    31         float f;
    32         double d;
    33         long double l;
    34 
    3531        //---------------------- Nearest Integer ----------------------
    3632
  • tests/maybe.cfa

    r70670e7 r10b5970  
    6060}
    6161
    62 int main(int argc, char * argv[]) {
     62int main() {
    6363        checkPredicates();
    6464        checkGetter();
  • tests/poly-d-cycle.cfa

    r70670e7 r10b5970  
    2020func_table(int) an_instance = { func };
    2121
    22 int main(int argc, char * argv[]) {
     22int main() {
    2323        object(int) x = { 0p };
    2424        an_instance.object_func( &x );
  • tests/poly-member.cfa

    r70670e7 r10b5970  
    1515                MonoCell thing1;
    1616                Proxy(int) & thing2 = thing1.data;
     17                (void) thing2;
    1718        }
    1819
     
    2021                PolyCell(int) thing1;
    2122                Proxy(int) & thing2 = thing1.data;
     23                (void) thing2;
    2224        }
    2325
  • tests/poly-o-cycle.cfa

    r70670e7 r10b5970  
    2020func_table(int) an_instance = { func };
    2121
    22 int main(int argc, char * argv[]) {
     22int main() {
    2323        object(int) x = { 0p };
    2424        an_instance.object_func( &x );
  • tests/quotedKeyword.cfa

    r70670e7 r10b5970  
    1515
    1616#include <fstream.hfa>
     17
     18#pragma GCC diagnostic ignored "-Wunused-variable"
    1719
    1820static struct {
  • tests/raii/partial.cfa

    r70670e7 r10b5970  
    1212    // Declaring your own empty ctor leaves an autogen dtor usable
    1313    struct thing1 {};
    14     void ?{}( thing1 & this ) {  printf( "custom ctor\n"); }
     14    void ?{}( thing1 & ) {  printf( "custom ctor\n"); }
    1515    void test1() {
    1616        printf("test1\n");
     
    2020    // Declaring your own empty ctor and dtor leaves an autogen copy ctor usable
    2121    struct thing2 {};
    22     void  ?{}( thing2 & this ) {  printf( "custom ctor\n"); }
    23     void ^?{}( thing2 & this ) {  printf( "custom dtor\n"); }
     22    void  ?{}( thing2 & ) {  printf( "custom ctor\n"); }
     23    void ^?{}( thing2 & ) {  printf( "custom dtor\n"); }
    2424    void test2() {
    2525        printf("test2\n");
     
    3737
    3838    struct thing456 {};
    39     void    ?{}( thing456 & this ) {  printf( "custom ctor\n"); }
     39    void    ?{}( thing456 & ) {  printf( "custom ctor\n"); }
    4040    void    ?{}( thing456 &, thing456 ) = void;
    4141    thing456 & ?=?( thing456 &, thing456 ) = void;
    42     void   ^?{}( thing456 & this ) {  printf( "custom dtor\n"); }
     42    void   ^?{}( thing456 & ) {  printf( "custom dtor\n"); }
    4343
    4444    struct wrapper1 { thing456 x; };
     
    8080// Declaring your own empty ctor leaves an autogen dtor usable
    8181struct thing1 {};
    82 void ?{}( thing1 & this ) {  printf( "custom ctor\n"); }
     82void ?{}( thing1 & ) {  printf( "custom ctor\n"); }
    8383void test1() {
    8484    printf("test1\n");
     
    8888// Declaring your own empty ctor and dtor leaves an autogen copy ctor usable
    8989struct thing2 {};
    90 void  ?{}( thing2 & this ) {  printf( "custom ctor\n"); }
    91 void ^?{}( thing2 & this ) {  printf( "custom dtor\n"); }
     90void  ?{}( thing2 & ) {  printf( "custom ctor\n"); }
     91void ^?{}( thing2 & ) {  printf( "custom dtor\n"); }
    9292void test2() {
    9393    printf("test2\n");
     
    105105
    106106struct thing456 {};
    107 void    ?{}( thing456 & this ) {  printf( "custom ctor\n"); }
     107void    ?{}( thing456 & ) {  printf( "custom ctor\n"); }
    108108void    ?{}( thing456 &, thing456 ) = void;
    109109thing456 & ?=?( thing456 &, thing456 ) = void;
    110 void   ^?{}( thing456 & this ) {  printf( "custom dtor\n"); }
     110void   ^?{}( thing456 & ) {  printf( "custom dtor\n"); }
    111111
    112112struct wrapper1 { thing456 x; };
  • tests/result.cfa

    r70670e7 r10b5970  
    6161}
    6262
    63 int main(int argc, char * argv[]) {
     63int main() {
    6464        checkPredicates();
    6565        //checkNamedConstructors();
  • tests/sizeof.cfa

    r70670e7 r10b5970  
    33#include <fstream.hfa>
    44
    5 int main(int argc, char * argv[]) {
     5int main() {
    66        char val = 'c';
    77        char & ref = val;
     
    99        sout | "char  : " | sizeof(val) | alignof(val);
    1010        sout | "char &: " | sizeof(ref) | alignof(ref);
     11
     12        // FIX ME: work around Trac #300
     13        (void) val;
     14        (void) ref;
    1115}
  • tests/smart-pointers.cfa

    r70670e7 r10b5970  
    6565}
    6666
    67 int main(int argc, char * argv[]) {
     67int main() {
    6868        counter_test();
    6969        unique_test();
  • tests/tuple/tupleAssign.cfa

    r70670e7 r10b5970  
    4848                        int z;
    4949                } x;
    50                 X ?=?(X & x, double d) { return x; }
     50                X ?=?(X & x, double) { return x; }
    5151                [int, double, int] t;
    5252
  • tests/tuple/tuplePolymorphism.cfa

    r70670e7 r10b5970  
    6666forall(T)
    6767[T, T] foo([T, T] y) {
     68        (void) y;
    6869        [T, T] x;
    6970        return x;
  • tests/tuple/tupleVariadic.cfa

    r70670e7 r10b5970  
    9898}
    9999
    100 forall(T... | { void foo(T); }) void bar(T x) {}
     100forall(T... | { void foo(T); }) void bar( T ) {}
    101101void foo(int) {}
    102102
     
    126126        {
    127127                // T = [const int] -- this ensures that void(*)(int) satisfies void(*)(const int)
    128                 const int x;
     128                const int x = 42;
    129129                bar(x);
    130130        }
  • tests/typeof.cfa

    r70670e7 r10b5970  
    1010        (typeof(v1)) v2; // cast with typeof
    1111        printf( "done\n" );                             // non-empty .expect file
     12
     13        // FIX ME: work around Trac #300
     14        (void) v1;
     15        (void) v3;
     16        (void) v4;
     17        (void) v5;
     18        (void) v6;
     19        (void) v7;
     20        (void) v8;
    1221}
Note: See TracChangeset for help on using the changeset viewer.