C, C++: Fix PR 69733 (bad location for ignored qualifiers warning)

Bernd Schmidt bschmidt@redhat.com
Wed May 4 15:17:00 GMT 2016


On 04/25/2016 10:18 PM, Joseph Myers wrote:
> On Fri, 22 Apr 2016, Bernd Schmidt wrote:
>
>> +/* Returns the smallest location != UNKNOWN_LOCATION in LOCATIONS,
>> +   considering only those c_declspec_words found in LIST, which
>> +   must be terminated by cdw_number_of_elements.  */
>> +
>> +static location_t
>> +smallest_type_quals_location (const location_t* locations,
>> +			      c_declspec_word *list)
>
> I'd expect list to be a pointer to const...
>
>> @@ -6101,6 +6122,18 @@ grokdeclarator (const struct c_declarato
>>   	       qualify the return type, not the function type.  */
>>   	    if (type_quals)
>>   	      {
>> +		enum c_declspec_word ignored_quals_list[] =
>> +		  {
>> +		    cdw_const, cdw_volatile, cdw_restrict, cdw_address_space,
>> +		    cdw_number_of_elements
>> +		  };
>
>   ... and ignored_quals_list to be static const here.
>
How's this? Fully retested on x86_64-linux.


Bernd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: declspecs-v2.diff
Type: text/x-patch
Size: 5559 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160504/1f3c9535/attachment.bin>


More information about the Gcc-patches mailing list