This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C, C++: Fix PR 69733 (bad location for ignored qualifiers warning)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Bernd Schmidt <bernds_cb1 at t-online dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Bernd Schmidt <bschmidt at redhat dot com>, Jason Merrill <jason at redhat dot com>
- Date: Mon, 25 Apr 2016 20:18:07 +0000
- Subject: Re: C, C++: Fix PR 69733 (bad location for ignored qualifiers warning)
- Authentication-results: sourceware.org; auth=none
- References: <571A2697 dot 4050208 at t-online dot de>
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.
--
Joseph S. Myers
joseph@codesourcery.com