Message ID | d91500ba-8c10-c00c-95b7-57a6e5b22d8f@suse.cz |
---|---|
State | New |
Headers | show |
Series | [pushed] s390x: Fix one more -Wformat-diag. | expand |
On Thu, Feb 03, 2022 at 09:56:25AM +0100, Martin Liška wrote: > gcc/ChangeLog: > > * config/s390/s390.cc (s390_valid_target_attribute_inner_p): > Use the error message for i386 target. > --- > gcc/config/s390/s390.cc | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc > index 2db12d4ba4b..63b78ab16d8 100644 > --- a/gcc/config/s390/s390.cc > +++ b/gcc/config/s390/s390.cc > @@ -15903,7 +15903,7 @@ s390_valid_target_attribute_inner_p (tree args, > /* Process the option. */ > if (!found) > { > - error ("attribute(target(\"%s\")) is unknown", orig_p); > + error ("attribute %qs argument %<target%> is unknown", orig_p); This is backwards, isn't it? It should be "attribute %<target%> argument %qs is unknown", no? > return false; > } > else if (attrs[i].only_as_pragma && !force_pragma) > @@ -15953,7 +15953,7 @@ s390_valid_target_attribute_inner_p (tree args, > } > else > { > - error ("attribute(target(\"%s\")) is unknown", orig_p); > + error ("attribute %qs argument %<target%> is unknown", orig_p); > ret = false; > } > } > @@ -15970,7 +15970,7 @@ s390_valid_target_attribute_inner_p (tree args, > global_dc); > else > { > - error ("attribute(target(\"%s\")) is unknown", orig_p); > + error ("attribute %qs argument %<target%> is unknown", orig_p); > ret = false; > } > } > -- > 2.34.1 Jakub
On 2/3/22 10:08, Jakub Jelinek wrote: > This is backwards, isn't it? It should be > "attribute %<target%> argument %qs is unknown", no? Oh, correct: cat x.c && gcc x.c -c int __attribute__((target("-ff"))) foo() { } x.c:1:36: error: attribute ‘-ff’ argument ‘target’ is unknown 1 | int __attribute__((target("-ff"))) foo() { } | ^~~ Let me prepare a patch for both targets. Martin
diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc index 2db12d4ba4b..63b78ab16d8 100644 --- a/gcc/config/s390/s390.cc +++ b/gcc/config/s390/s390.cc @@ -15903,7 +15903,7 @@ s390_valid_target_attribute_inner_p (tree args, /* Process the option. */ if (!found) { - error ("attribute(target(\"%s\")) is unknown", orig_p); + error ("attribute %qs argument %<target%> is unknown", orig_p); return false; } else if (attrs[i].only_as_pragma && !force_pragma) @@ -15953,7 +15953,7 @@ s390_valid_target_attribute_inner_p (tree args, } else { - error ("attribute(target(\"%s\")) is unknown", orig_p); + error ("attribute %qs argument %<target%> is unknown", orig_p); ret = false; } } @@ -15970,7 +15970,7 @@ s390_valid_target_attribute_inner_p (tree args, global_dc); else { - error ("attribute(target(\"%s\")) is unknown", orig_p); + error ("attribute %qs argument %<target%> is unknown", orig_p); ret = false; } }