On Mon, May 23, 2022 at 06:43:55PM +0200, Andrea Monaco via Gcc wrote:
> 
> This snippet that I wrote
> 
> 
>   struct
>   str
>   {
>     int val;
>   };  
> 
> 
>   void
>   main (int argc, char **argv)
>   {
>     struct str **p;
>     int i;
>   
>     i = p->val;
>   }
> 
> 
> is obviously incorrect.  But gcc 8.3.0 says
> 
>   pointer.c: In function ‘main’:
>   pointer.c:14:8: error: ‘*p’ is a pointer; did you mean to use ‘->’?
>      i = p->val;
>           ^~
>           ->
> 
> which seems a buggy error message to me: I wrote "p", not "*p"; also the
> compiler suggests replacing "->" with itself.

Yes, this is https://gcc.gnu.org/PR91134

Marek

Reply via email to