Skip to content

Commit 8416727

Browse files
author
Daniel Kroening
committed
allow values for -m gcc options
1 parent 6a93344 commit 8416727

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/goto-cc/gcc_cmdline.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,15 @@ bool gcc_cmdlinet::parse(int argc, const char **argv)
241241
}
242242
else if(has_prefix(argv_i, "-m")) // m-options
243243
{
244-
set(argv_i);
244+
// these sometimes come with a value separated by '=', e.g., -march=cpu_type
245+
246+
std::size_t equal_pos=argv_i.find('=');
247+
248+
if(equal_pos==std::string::npos)
249+
set(argv_i); // no value
250+
else
251+
set(std::string(argv_i, 0, equal_pos),
252+
std::string(argv_i, equal_pos+1, std::string::npos));
245253
}
246254
else if(in_list(argv[i], gcc_options_without_argument)) // without argument
247255
{

0 commit comments

Comments
 (0)