options: properly compare string arguments
Similarly to 7f967bd2a7
, we need to
compare string with strcmp.
gcc/ChangeLog:
PR c++/97284
* optc-save-gen.awk: Compare also n_target_save vars with
strcmp.
This commit is contained in:
parent
b2230210f1
commit
e91910d357
1 changed files with 4 additions and 2 deletions
|
@ -1036,8 +1036,10 @@ for (i = 0; i < n_target_save; i++) {
|
|||
type = var;
|
||||
sub("^.*[ *]", "", name)
|
||||
sub(" *" name "$", "", type)
|
||||
if (target_save_decl[i] ~ "^const char \\*+[_" alnum "]+$")
|
||||
if (target_save_decl[i] ~ "^const char \\*+[_" alnum "]+$") {
|
||||
var_target_str[n_target_str++] = name;
|
||||
string_options_names[name]++
|
||||
}
|
||||
else {
|
||||
if (target_save_decl[i] ~ " .*\\[.+\\]+$") {
|
||||
size = name;
|
||||
|
@ -1451,7 +1453,7 @@ for (i = 0; i < n_opts; i++) {
|
|||
continue;
|
||||
checked_options[name]++
|
||||
|
||||
if (name in string_options_names) {
|
||||
if (name in string_options_names || ("x_" name) in string_options_names) {
|
||||
print " if (ptr1->x_" name " != ptr2->x_" name "";
|
||||
print " && (!ptr1->x_" name" || !ptr2->x_" name
|
||||
print " || strcmp (ptr1->x_" name", ptr2->x_" name ")))";
|
||||
|
|
Loading…
Add table
Reference in a new issue