On Wed, Mar 05, 2014 at 10:56:39AM +0400, Yury Gribov wrote: > >I'm not sure what you asking for here. But to learn how to format > >your code, I think just look at the GCC source code and model your > >code after that. > > > > I am not understanding the standard.For example,should I use \t > > instead of space?Should I use 4 spaces as indent or 2? > > My understanding is that GCC coding guidelines > (http://gcc.gnu.org/contribute.html#standards) > don't require particular indentation style so you should probably > stick to a style > used in particular file (or even particular function). > > That said GCC's lack of indentation standard is IMHO rather unfortunate.
That is not true. The indentation style is: http://www.gnu.org/prep/standards/standards.html#Formatting (though, some parts of gcc, e.g. libstdc++, use slightly different indentation/formatting style). The above also mentions particular options for GNU indent which set various rules. -i2 means indentation is by 2 spaces, and the lack of -nut and -tsN options means that tab size is 8 columns and that in the indentation every 8 spaces should be replaced by a tab. Jakub