Changeset 3322180 for src/Validate


Ignore:
Timestamp:
Jun 24, 2022, 12:12:26 PM (22 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
5a076837
Parents:
d28524a
Message:

Fix enum assignment warning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/Autogen.cpp

    rd28524a r3322180  
    183183        {
    184184                // TODO: These functions are somewhere between instrinsic and autogen,
    185                 // could possibly use a new linkage type. For now we just make them
    186                 // intrinsic to code-gen them as C assignments.
    187                 proto_linkage = ast::Linkage::Intrinsic;
     185                // could possibly use a new linkage type. For now we just make the
     186                // basic ones intrinsic to code-gen them as C assignments.
     187                const auto & real_type = decl->base;
     188                const auto & basic = real_type.as<ast::BasicType>();
     189                if(!real_type || (basic && basic->isInteger())) proto_linkage = ast::Linkage::Intrinsic;
    188190        }
    189191
     
    402404        auto retval = srcParam();
    403405        retval->name = "_ret";
    404         // xxx - Adding this unused attribute can slience unused variable warning
    405         // However, some code might not be compiled as expected
    406         // Temporarily disabled
    407         // retval->attributes.push_back(new ast::Attribute("unused"));
    408406        return genProto( "?=?", { dstParam(), srcParam() }, { retval } );
    409407}
Note: See TracChangeset for help on using the changeset viewer.