[PATCH] cleanup gcse.c:canon_modify_mem_list

Richard Earnshaw rearnsha@arm.com
Tue Apr 5 14:40:00 GMT 2011


On Tue, 2011-04-05 at 07:07 -0600, Jeff Law wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 04/05/11 06:55, Richard Earnshaw wrote:
> > 
> > On Tue, 2011-04-05 at 05:30 -0700, Nathan Froyd wrote:
> >> On Tue, Apr 05, 2011 at 01:22:39PM +0100, Richard Earnshaw wrote:
> >>> On Tue, 2011-04-05 at 04:44 -0700, Nathan Froyd wrote:
> >>>>> nit; You're missing some whitespace here (after the VEC).
> >>>>
> >>>> This doesn't seem to be a hard-and-fast policy; all of the VEC code I
> >>>> remember writing or looking at recently has no spaces, and I checked the
> >>>> patch in on that basis.  However, running grep indicates that we have a
> >>>> profusion of styles...
> >>>
> >>> I think the style guide is quite clear on this: there should be a space
> >>> there as Jeff says.  The fact that some code has crept in with other
> >>> styles doesn't make them right, or give justification for ignoring the
> >>> style guide.
> >>
> >> Would you like a patch for the hundreds of instances without spaces?
> >>
> >> Certainly vec.h never uses spaces; I thought this was simply The Way
> >> Things Were.
> >>
> >> -Nathan
> >>
> > 
> > IMO, rototils are generally pointless.  If you are fixing code nearby
> > then yes, fix the formatting issues.  Otherwise, just don't exacerbate
> > the problem, or we'll reach the point where a rototil really does become
> > necessary.
> Well, the other approach is to have a commit hook which automatically
> deals with formatting crap by running indent, or whatever tool we want.
> 
> That would take the decision out of the hands of the developer and free
> the reviewer from having to catch such things and ensures there is a
> canonical form for our sources.

Only if a tool either

1) Has a way to over-ride it when it's being stupid, or...
2) is never stupid...

Most indent tools don't handle comments very well, IMO.  For example:

  /* Some commentary text...

	Some Code Fragment

     some more commentary text.  */

if you auto-indent that, you'll often end up with the code fragment,
which was deliberately given extra indentation being moved to the same
indentation as the surrounding text.  In some cases that can lose
important information.

R.




More information about the Gcc-patches mailing list