Skip to content

Commit 0f9c202

Browse files
authored
Merge pull request diffblue#2242 from diffblue/section-name-warning
remove a warning about section names
2 parents b7f5886 + 8f6bae0 commit 0f9c202

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/ansi-c/c_typecheck_base.cpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -723,23 +723,25 @@ void c_typecheck_baset::typecheck_declaration(
723723
{
724724
// section name is not empty, do a bit of parsing
725725
std::string asm_name = id2string(full_spec.section);
726-
if(asm_name[0] != '.')
726+
727+
if(asm_name[0] == '.')
727728
{
728-
warning().source_location = symbol.location;
729-
warning() << "section name `" << asm_name
730-
<< "' expected to start with `.'" << eom;
729+
std::string::size_type primary_section = asm_name.find('.', 1);
730+
731+
if(primary_section != std::string::npos)
732+
asm_name.resize(primary_section);
731733
}
732-
std::string::size_type primary_section = asm_name.find('.', 1);
733-
if(primary_section != std::string::npos)
734-
asm_name.resize(primary_section);
734+
735735
asm_name += "$$";
736+
736737
if(!full_spec.asm_label.empty())
737738
asm_name+=id2string(full_spec.asm_label);
738739
else
739740
asm_name+=id2string(symbol.name);
740741

741742
apply_asm_label(asm_name, symbol);
742743
}
744+
743745
irep_idt identifier=symbol.name;
744746
d_it->set_name(identifier);
745747

0 commit comments

Comments
 (0)