any consensus on "register" storage class?

David Daney ddaney at avtrex.com
Tue May 16 16:30:03 UTC 2006


walter harms wrote:
> hi,
> today we did some test with gcc 4 on i586 and found that register is a 
> placebo, sometimes even slower than int (gcc strangeness).
> 

Almost invariably GCC will do a better job at register allocation than a 
human programmer.  I don't find your results strange at all.


> i would suggest:
> #define register
> 

That will not work in general as the following declaration is legal:

    register k;

With your define, removing the 'register' keyword results in a syntax error.

My suggestion is to remove register declarations on a case by case 
basis.  This would have the added advantage of not confusing people 
looking at the register declaration and thinking that it actually does 
something.

David Daney



> re,
>  wh
> 
> Robert P. J. Day wrote:
> 
>>   did anyone ever decide whether there was any point in retaining the
>> numerous examples of the "register" storage class?
>>
>> rday



More information about the busybox mailing list