Changeset 4be0117


Ignore:
Timestamp:
Feb 21, 2025, 3:16:04 PM (5 weeks ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
9506c70
Parents:
8705a11
Message:

Cleaned the warnings from exceptions tests. Mostly explicit fallthrough which we do need for now. There was an error in defaults, although not one that mattered.

Location:
tests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tests/Makefile.am

    r8705a11 r4be0117  
    7676# Tests that need investigation from the CFA team about why they require lax wflags.  Goal is to eliminate this list.
    7777WFLAGS_OPT_LAX_TO_INVESTIGATE = \
    78         exceptions/cardgame \
    79         exceptions/defaults \
    80         exceptions/defaults-threads \
    81         exceptions/try-leave-catch \
    8278        forall \
    8379        include/includes \
  • TabularUnified tests/exceptions/cardgame.cfa

    r8705a11 r4be0117  
    2929
    3030static unsigned int NumPlayersRemaining;                                // number of players currently in the game
    31 static unsigned int rounds;                                                             // count rounds during Schmilblick
    3231
    3332static unsigned int MakePlay( Player & player, unsigned int RemainingCards ) with( player ) {
     
    125124                                seed = convert( argv[4] ); if ( seed < 1 ) throw ExceptionInst( cmd_error ); // invalid ?
    126125                        } // if
    127                         // FALL THROUGH
     126                        fallthrough;
    128127                  case 4:
    129128                        if ( strcmp( argv[3], "d" ) != 0 ) {            // default ?
     
    131130                                cardsSet = true;
    132131                        } // if
    133                         // FALL THROUGH
     132                        fallthrough;
    134133                  case 3:
    135134                        if ( strcmp( argv[2], "d" ) != 0 ) {            // default ?
     
    137136                                playersSet = true;
    138137                        } // if
    139                         // FALL THROUGH
     138                        fallthrough;
    140139                  case 2:
    141140                        if ( strcmp( argv[1], "d" ) != 0 ) {            // default ?
    142141                                numGames = convert( argv[1] ); if ( numGames < 0 ) throw ExceptionInst( cmd_error ); // invalid ?
    143142                        } // if
    144                         // FALL THROUGH
     143                        fallthrough;
    145144                  case 1:                                                                               // defaults
    146145                        break;
  • TabularUnified tests/exceptions/defaults.cfa

    r8705a11 r4be0117  
    6666
    6767void unhandled_test(void) {
     68        void defaultTerminationHandler(unhandled_exception &) {
     69                abort();
     70        }
    6871        forall(T &, V & | is_exception(T, V))
    6972        void defaultTerminationHandler(T &) {
    7073                throw (unhandled_exception){&unhandled_vt};
    71         }
    72         void defaultTerminationHandler(unhandled_exception &) {
    73                 abort();
    7474        }
    7575        try {
  • TabularUnified tests/exceptions/try-leave-catch.cfa

    r8705a11 r4be0117  
    3838                        break;
    3939                }
     40                fallthrough;
    4041        default:
    4142                printf("Reached default.\n");
Note: See TracChangeset for help on using the changeset viewer.