On Thu, 12 Nov 2015, David Malcolm wrote: > On Tue, 2015-11-10 at 17:55 +0000, Joseph Myers wrote: > > On Tue, 10 Nov 2015, David Malcolm wrote: > > > > > This is the most trivial example of a real fix-it example I could think > > > of: if the user writes > > > ptr.field > > > rather than ptr->field. > > > > > > gcc/c/ChangeLog: > > > * c-typeck.c (build_component_ref): Special-case POINTER_TYPE when > > > generating a "not a structure of union" error message, and > > > suggest a "->" rather than a ".", providing a fix-it hint. > > > > I wonder if this should be restricted to the case where the pointer's > > target is of structure or union type. > > Probably. Attached is an updated version of the patch that does so.
This patch is OK. -- Joseph S. Myers jos...@codesourcery.com