LWN.net Logo

Quotes of the week

Quotes of the week

Posted Aug 23, 2012 16:48 UTC (Thu) by zlynx (subscriber, #2285)
In reply to: Quotes of the week by cate
Parent article: Quotes of the week

The register keyword is quite handy for cases where you would like it to be in a register because the compiler will prevent the programmer from messing up the possibility.

For example:
register-test.c:7:2: error: address of register variable ā€˜i’ requested

GCC does not allow the programmer to get the address of a "register" variable.

So it is like "const." It keeps you from doing something dumb.


(Log in to post comments)

Quotes of the week

Posted Sep 3, 2012 8:37 UTC (Mon) by philomath (guest, #84172) [Link]

It's not GCC, it's the standard.

Quotes of the week

Posted Sep 3, 2012 16:47 UTC (Mon) by khim (subscriber, #9252) [Link]

Yup. And of course it does not work with C++ at all (that is: it's perfectly fine to take address of register variable in C++).

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds