TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Rider
from: Mike Burgett
date: 1995-06-12 16:41:08
subject: Register Variables

Hi Paul,

Replying to a message of Paul Rider to All:

 PR> Hello All,

 PR> I know the keyword 'register' will (if possible) direct the compiler
 PR> to use a register for a variable... Is there anything I can do (short
 PR> of shutting optimization off) to make sure the compiler doesn't use a
 PR> register for a variable?

Sure, if the compiler is ANSI complient, all you have to do is take the
address of the variable somewhere and it can't be hoisted into a register
by the optimizer.

The keyword 'volatile' should have a similar effect.

Thanks,
Mike

... Home of MALUM_PROHIBITUM (now on the Fido Backbone & Planet Connect)

--- FleetStreet 1.04 #514
* Origin: Common Sense BBS, FIDO-PRN-OS2NET & More (1:215/705)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 215/705 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.