gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Problematic "register" keyword


From: Jerry James
Subject: [Gcl-devel] Problematic "register" keyword
Date: Thu, 21 May 2009 13:03:52 -0600

The "register" keyword is a promise to never take the address of a
variable.  When using an ellipsis to create a variable argument
function, the last parameter before the ellipsis is passed to
va_start(), which uses the address of that parameter to find the
unnamed parameters.

We have a case where the last parameter before an ellipsis is declared
"register", which means that we are breaking our promise to the
compiler to never take the address of that parameter.  GCC 4.4.0
issues a warning about undefined behavior.  The fix is to remove the
"register" declaration.  The attached patch does so.

Regards,
-- 
Jerry James
http://www.jamezone.org/

Attachment: gcl-2.7.0-register.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]