[PATCH][v2] Fix target attribute handling (PR c++/81355).

Jason Merrill jason@redhat.com
Tue Aug 8 16:36:00 GMT 2017


On Tue, Aug 8, 2017 at 12:59 AM, Martin Liška <mliska@suse.cz> wrote:
> On 08/02/2017 09:56 PM, Martin Sebor wrote:
>> On 08/02/2017 01:04 PM, Jeff Law wrote:
>>> On 07/28/2017 05:13 AM, Martin Liška wrote:
>>>> Hello.
>>>>
>>>> Following patch skips empty strings in 'target' attribute.
>>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>>>>
>>>> Ready to be installed?
>>>> Martin
>>>>
>>>> gcc/ChangeLog:
>>>>
>>>> 2017-07-13  Martin Liska  <mliska@suse.cz>
>>>>
>>>>     PR c++/81355
>>>>     * attribs.c (sorted_attr_string): Skip empty strings.
>>>>
>>>> gcc/testsuite/ChangeLog:
>>>>
>>>> 2017-07-13  Martin Liska  <mliska@suse.cz>
>>>>
>>>>     PR c++/81355
>>>>     * g++.dg/other/pr81355.C: New test.
>>> OK.  THough one could legitimately ask if this ought to be a parsing error.
>>
>> I would suggest to at least issue a warning.  It seems that
>> the empty string must almost certainly be a bug here, say due
>> to unintended macro expansion.
>>
>> Otherwise, if it should remain silently (and intentionally)
>> accepted, I recommend to document it.  As it is, the manual
>> says that the "string" argument is equivalent to compiling
>> with -mstring which for "" would be rejected by the driver.
>>
>> Martin
>
> Thanks you both for feedback. I decided to come up with an error message for that.
>
> Feedback appreciated.

I'd think to check it in handle_target_argument rather than require
all targets to check it.

Jason



More information about the Gcc-patches mailing list