Subject: Re: [PATCH GIT 0.6] make use of register variables & size_t

From: "David A. Wheeler" <[email-masked]>
Date: Mon, 25 Apr 2005 14:06:19 -0400

Rene Rebe wrote:

> Hi,
>
> Matthias-Christian Ott wrote:
>
>> The "git" didn't try store small variables, which aren't referenced, 
>> in the processor registers. It also didn't use the size_t type. I 
>> corrected a C++ style comment too.
>
>
> Well, modern compilers take register as a non-binding hint. Your 
> register storage specification for those loop counters will not make 
> any change. You have not looked into the resulting binary?

Indeed, register was ALWAYS a non-binding hint. Today,
unless you have specific measurements showing that adding "register"
at some point improves the performance for a (somewhat common) situation,
you're better off NOT including "register" nowadays.  Today's compilers
are generally better at allocating registers than 
people-who-have-little-time.
Premature optimization is the root of all kinds of evil...

> Also // is valid C99 ...

It's not, strictly speaking, okay on old pre-C99 compilers.
But in practice, practically all C compilers from the last 10+ years
have accepted // comments as a very popular extension.
So using "//" is unlikely to be a portability problem, even on semi-old 
compilers.

--- David A. Wheeler