<br><div class="gmail_quote">On Nov 13, 2007 2:49 PM, Ken Pizzini <<a href="mailto:email@example.com">firstname.lastname@example.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Tue, Nov 13, 2007 at 09:46:13AM -0500, Arthur David Olson wrote:<br>> My own use of "register" isn't to provide compilers with hints but<br>> rather to avoid unintended calls by reference;
<br><br></div>Is it possible to make "unintended calls by reference", without at<br>least a stern warning from the compiler (if not an outright error)<br>in the world of prototyped function calls? Passing a pointer-to-T
<br>is quite different from passing a value of type T, after all.<font color="#888888"><br></font></blockquote></div><br>To pass by reference, you have to apply the 'address-of' operator to the variable: &variable.
<br>The register storage class prevents you applying & to a variable.<br><br>But you're correct: except in the weird world of the void pointer (and pointer to void pointer, etc), with prototypes in force, you can't pass variable where &variable is correct (or vice versa), so forgetting to apply the & would be an error spotted by the compiler.
<br><br>-- <br>Jonathan Leffler <<a href="mailto:email@example.com">firstname.lastname@example.org</a>> #include <disclaimer.h><br>Guardian of DBD::Informix - v2007.0914 - <a href="http://dbi.perl.org">http://dbi.perl.org
</a><br>"Blessed are we who can laugh at ourselves, for we shall never cease to be amused."