Changeset 0bf03ba2


Ignore:
Timestamp:
Dec 20, 2024, 9:38:52 PM (11 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
0cd168f
Parents:
3df3a8f
Message:

Remove warnings due to unused parameters in generated code for zero-length ttype instantiations.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Specialize.cpp

    r3df3a8f r0bf03ba2  
    300300                } ),
    301301                map_range<DWTVector>( newType->params, [&location, &paramNamer]( const ast::Type * type ) {
    302                         return new ast::ObjectDecl( location, paramNamer.newName(), ast::deepCopy( type ) );
     302                        auto param = new ast::ObjectDecl( location, paramNamer.newName(), ast::deepCopy( type ) );
     303                        param->attributes.push_back( new ast::Attribute( "unused" ) );
     304                        return param;
    303305                } ),
    304306                map_range<DWTVector>( newType->returns, [&location, &paramNamer]( const ast::Type * type ) {
  • src/InitTweak/FixInit.cpp

    r3df3a8f r0bf03ba2  
    7070                ast::Linkage::Cforall
    7171        );
     72        dstParam->attributes.push_back( new ast::Attribute( "unused" ) );
    7273        return new ast::FunctionDecl( loc,
    7374                fname,
  • tests/Makefile.am

    r3df3a8f r0bf03ba2  
    5252WFLGAS_OPT_LAX = \
    5353        alloc \
    54         alloc2 \
    5554        array \
    5655        array-collections/array-raii-c \
     
    9897        concurrency/examples/boundedBufferEXT \
    9998        concurrency/examples/boundedBufferINT \
    100         concurrency/futures/abandon \
    10199        concurrency/futures/multi \
    102100        concurrency/futures/select_future \
     
    179177        function-operator \
    180178        gmp \
    181         heap \
    182179        identFuncDeclarator \
    183180        identParamDeclarator \
  • tests/nowarn/unused.cfa

    r3df3a8f r0bf03ba2  
    1717enum () foo_t { foo };
    1818
     19// on empty tuple,  __cleanup_dtor takes zero actions on its param and
     20// _thunk's purpose is to ignore its param
     21forall( Args... | { void foo( Args ); } )
     22void wrap( Args ) {}
     23void foo() {}
     24void callWrap() {
     25    wrap();
     26}
     27
    1928
    2029int main() {
Note: See TracChangeset for help on using the changeset viewer.