This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GNU Coding Standards -- updated


On Wed, Aug 15, 2001 at 06:33:25PM -0700, Joe Buck wrote:
> So, for 2.95.2 there is space overhead but (almost) no time overhead
> modulo cache effects; for 3.0 there is neither space nor time overhead.

Thanks for testing!

In that case I whole-heartedly agree with this coding standard;

Old way			New way

--

if (x == 0)		if (x == 0)
  a = 1;		  a = 1;
else			else if (A2)
#ifdef A2		  a = 2;
  a = 2;		else
#else			  a = 0;
  a = 0;
#endif

--

if (x == 0)		if (x == 0)
  a = 1;		  a = 1;
#ifdef A2		else if (A2)
else			  a = 2;
  a = 2;
#endif

--

if (x == 0)		if (x == 0)
  a = 1;		  a = 1;
#ifdef A2		else if (A2)
else			  a = 2;
  a = 2;		else if (x == 1)
#else			  a = 3;
else if (x == 1)
  a = 3;
#endif

--

#ifndef A2		if (!A2 && x == 0)
if (x == 0)		  a = 1;
  a = 1;		else
else			  a = 2;
#endif
  a = 2;


Definitely.

-- 
Carlo Wood <carlo@alinoe.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]