Subject: Re: bug#59300: CC Mode 5.35.2 (C/*l); Yet another kind of incorrect type recognition

From: Alan Mackenzie <[email-masked]>
Date: Thu, 8 Dec 2022 21:03:39 +0000

Hello, Po.

On Wed, Nov 16, 2022 at 14:29:36 +0800, Po Lu via CC-Mode-help wrote:
> Package: cc-mode

> Insert the following text in a C mode buffer:

> static void
> Activate (Surface *surface, Role *role, int deviceid,
> 	  Timestamp timestamp, Surface *activator_surface)
> {
>   struct wl_resource *resource;
>   TestSurface *test;

>   test = TestSurfaceFromRole (role);

>   if (test->role.resource)
>     {
>       /* If the activator surface belongs to the same client as the
> 	 client who created the test surface, set the resource to the
> 	 activator surface.  */
>       if (wl_resource_get_client (activator_surface->resource)
> 	  == wl_resource_get_user_data (test->role.resource))
	
>       test_surface_send_activated (test->role.resource,
> 				   timestamp.months,
> 				   timestamp.milliseconds,
> 				   resource);
>     }
> }

> Place point at the end of the line below "wl_resource_get_user_data
> (test->role.resource))".  Type:

>   r e s o u r c e =

> Afterwards, every occurrence of `resource' will become found as a type
> and fontified incorrectly.

> Thanks.

I've got working code which fixes this.  It's a matter of integrating it
into the committed version without damaging anything else.  I'm hoping
to have this done in a few days.

> Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu)
>  of 2022-11-12
> Package: CC Mode 5.35.2 (C/*l)
> Buffer Style: gnu
> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties category-properties 1-bit)

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).