[PATCH] cleanup gcse.c:canon_modify_mem_list

Joseph S. Myers joseph@codesourcery.com
Tue Apr 5 19:18:00 GMT 2011


On Tue, 5 Apr 2011, 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.

I also had the impression that for certain special macros such as VEC, 
GTY, _, N_, G_ - macros that are not really substituting for functions, 
for-loops, etc. - the norm was no space, whereas for function prototypes, 
function calls and calls to macros that are being used syntactically and 
semantically more or less like functions the norm is to have the space 
(I'm not sure about the case of __attribute__ and macros generating 
__attribute__).  But I see VEC is in fact used more often with the space.  
(For the VEC_* macros used like functions rather than in type names, the 
norm is very clearly to have the space.)

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list