Keyword register

From: Ioannis Vranos (ivr_at_remove.this.grad.com)
Date: 11/23/04


Date: Tue, 23 Nov 2004 12:29:45 +0200

Just some thought on it, wanting to see any explanations.

It was advised in this newsgroups that we should avoid the use of
keyword register.

However it is a language feature, and if it offers no help to an
implementation, it is free to ignore it. And this happens widely, all my
C++ compilers in my platform ignore this keyword.

Also the use of register provides the additional guarantee that we do
not get the address of this variable which may indeed help an
implementation to optimise the variable access further, which was the
original purpose of its introduction after all.

So why we should not use register?

An implementation taking it into account means that the keyword helps it
indeed, otherwise the implementation *should* ignore it.

-- 
Ioannis Vranos
http://www23.brinkster.com/noicys


Relevant Pages

  • Re: Register keyword and "as if" rule...
    ... its way to take a full 10 minutes every time a "register" declared ... Then my compiler is still C compliant, ... keyword if they want their code to run smoothly on all implementations: ... Optimization hints in general are not nearly so important as they were ...
    (comp.lang.c)
  • Re: Can I pass OpenArgs to multiple instances of the same form?
    ... As you found, using the New keyword to open a form does not give you the option of OpenArgs, so you will be looking for alternate approaches. ... I want to be able to open a Bank1 register ... form and a Bank2 register form at the same time, ...
    (microsoft.public.access.forms)
  • RE: Internet Keyword System..
    ... The Chinese mainland has been pursuing domestic technologies rather than ... Those who failed to register ... Subject: Internet Keyword System.. ... Internet Keyword Service was launched by CNNIC (China ...
    (Security-Basics)
  • Re: Keyword register
    ... register storage class, whether the compiler ignores the hint or not. ... > An implementation taking it into account means that the keyword helps it ... In general, a programmer, particularly an applications ... It is in fact much like any other source code optimization. ...
    (comp.lang.cpp)
  • Re: Keyword register
    ... > It was advised in this newsgroups that we should avoid the use of ... > Also the use of register provides the additional guarantee that we do ... > implementation to optimise the variable access further, ...
    (comp.lang.cpp)