Changes in / [b738974:3b5dcfa]


Ignore:
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Common/SemanticError.h

    rb738974 r3b5dcfa  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May  4 14:08:26 2022
    13 // Update Count     : 35
     12// Last Modified On : Thu Jul 19 10:09:17 2018
     13// Update Count     : 31
    1414//
    1515
     
    5959        {"aggregate-forward-decl" , Severity::Warn    , "forward declaration of nested aggregate: %s"                },
    6060        {"superfluous-decl"       , Severity::Warn    , "declaration does not allocate storage: %s"                  },
    61         {"superfluous-else"       , Severity::Warn    , "else clause never executed for empty loop conditional"      },
    6261        {"gcc-attributes"         , Severity::Warn    , "invalid attribute: %s"                                      },
    6362        {"c++-like-copy"          , Severity::Warn    , "Constructor from reference is not a valid copy constructor" },
     
    7069        AggrForwardDecl,
    7170        SuperfluousDecl,
    72         SuperfluousElse,
    7371        GccAttributes,
    7472        CppCopy,
     
    8179);
    8280
    83 #define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id].message, ##__VA_ARGS__)
     81#define SemanticWarning(loc, id, ...) SemanticWarningImpl(loc, id, WarningFormats[(int)id].message, __VA_ARGS__)
    8482
    8583void SemanticWarningImpl (CodeLocation loc, Warning warn, const char * const fmt, ...) __attribute__((format(printf, 3, 4)));
  • src/Parser/parser.yy

    rb738974 r3b5dcfa  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May  4 14:25:20 2022
    13 // Update Count     : 5277
     12// Last Modified On : Mon Mar 14 16:35:29 2022
     13// Update Count     : 5276
    1414//
    1515
     
    111111
    112112void distInl( DeclarationNode * declaration ) {
    113         // distribute INLINE across all declarations
     113        // distribute EXTENSION across all declarations
    114114        for ( DeclarationNode *iter = declaration; iter != nullptr; iter = (DeclarationNode *)iter->get_next() ) {
    115115                iter->set_inLine( true );
     
    12211221
    12221222iteration_statement:
    1223         WHILE '(' ')' statement                                                         %prec THEN // CFA => while ( 1 )
     1223        WHILE '(' ')' statement                                                         // CFA => while ( 1 )
    12241224                { $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) ); }
    1225         | WHILE '(' ')' statement ELSE statement                        // CFA
    1226                 { SemanticWarning( yylloc, Warning::SuperfluousElse ); }
    12271225        | WHILE '(' conditional_declaration ')' statement       %prec THEN
    12281226                { $$ = new StatementNode( build_while( $3, maybe_build_compound( $5 ) ) ); }
     
    12311229        | DO statement WHILE '(' ')' ';'                                        // CFA => do while( 1 )
    12321230                { $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); }
    1233         | DO statement WHILE '(' ')' ELSE statement                     // CFA
    1234                 { SemanticWarning( yylloc, Warning::SuperfluousElse ); }
    12351231        | DO statement WHILE '(' comma_expression ')' ';'       %prec THEN
    12361232                { $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ) ) ); }
     
    23222318                        { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); }
    23232319
    2324                         $$ = DeclarationNode::newEnum( nullptr, $7, true, $3 )->addQualifiers( $5 );
     2320                        $$ = DeclarationNode::newEnum( nullptr, $7, true, $3 ) ->addQualifiers( $5 );
    23252321                }
    23262322        | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt
     
    23312327          '{' enumerator_list comma_opt '}'
    23322328                {
    2333                         $$ = DeclarationNode::newEnum( $6, $10, true, $3 )->addQualifiers( $5 )->addQualifiers( $7 );
     2329                        $$ = DeclarationNode::newEnum( $6, $10, true, $3 ) -> addQualifiers( $5 ) -> addQualifiers( $7 );
    23342330                }
    23352331        | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt typedef_name attribute_list_opt '{' enumerator_list comma_opt '}'
     
    23372333                        if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); }
    23382334                        typedefTable.makeTypedef( *$6->name );
    2339                         $$ = DeclarationNode::newEnum( $6->name, $9, true, $3 )->addQualifiers( $5 )->addQualifiers( $7 );
     2335                        $$ = DeclarationNode::newEnum( $6->name, $9, true, $3 ) -> addQualifiers( $5 ) -> addQualifiers( $7 );
    23402336                }
    23412337        | enum_type_nobody
Note: See TracChangeset for help on using the changeset viewer.