https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79775
Bug ID: 79775
Summary: Confusing fix-it diagnostics with double pointers to
structs
Product: gcc
Version: 6.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: felix.von.s at posteo dot de
Target Milestone: ---
Created attachment 40859
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40859&action=edit
test.c
Attempting to compile the attached source file emits the following diagnostic:
test.c: In function 'bar':
test.c:10:14: error: '*foo' is a pointer; did you mean to use '->'?
quux(*foo->a);
^~
->
The programmer's error is that they misremembered operator precedence rules:
struct member access binds stronger than pointer dereference. This diagnostic
above can only serve to confuse them further.