Ignore:
Timestamp:
Jul 2, 2026, 5:07:05 PM (3 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
7886a92f
Parents:
16d862d
Message:

remove addDataSectionAttribute hack and handle dynamic initialization of const definitions by removing the const after resolution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cpp

    r16d862d r13481af0  
    816816        if ( const ast::Stmt * ctor = ctorInit->ctor ) {
    817817                if ( objDecl->storage.is_static ) {
    818                         addDataSectionAttribute(objDecl);
     818                        // Remove const qualifier from definition and there can be no forward declarations.
     819                        if ( objDecl->type->is_const() ) {
     820                                ast::Type * fred = const_cast<ast::Type *>(objDecl->get_type());
     821                                fred->set_const( false );
     822                        }
    819823                        // originally wanted to take advantage of gcc nested functions, but
    820824                        // we get memory errors with this approach. To remedy this, the static
Note: See TracChangeset for help on using the changeset viewer.