#47902 [Fbk]: free_op1 warnings
| From: | kalle@php.net | Date: | Mon, 06 Apr 2009 13:54:20 +0000 |
| Subject: | #47902 [Fbk]: free_op1 warnings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-135588@lists.php.net to get a copy of this message | ||
ID: 47902
Updated by: kalle@php.net
Reported By: pierre dot php at gmail dot com
Status: Feedback
Bug Type: Compile Warning
PHP Version: 5.3CVS-2009-04-05 (snap)
Assigned To: dmitry
New Comment:
Dmitry, I looked at the MSDN for C4101 for example:
struct a {
static int b() {
return 1;
}
};
int main() {
A c;
int d = c.func();
return d;
}
The "A c;" line generates a C4101 because b is a static function and
therefore no instance is needed to call it, in C++ that would mean main
should looks like:
int main() {
int d = A::func();
return d;
}
Its documentation is at:
http://msdn.microsoft.com/en-us/library/c733d5h9(VS.80).aspx
Previous Comments:
------------------------------------------------------------------------
[2009-04-06 11:37:04] pajoye@php.net
It is not that important to fix, you asked me to open a bug about it
:)
However, there is no inaccurate behavior, if the code using this
variable is unreachable, then the variable is not used at all (typically
if (0) will striped out).
------------------------------------------------------------------------
[2009-04-06 11:25:34] dmitry@php.net
These warnings occurs because of inaccurate C compiler behaviour.
In case you look into zend\zend_vm_execute.h(17488) and the whole
function, you would see that free_op1 is used in this function, however
the code which references the variable is unreachable.
A general solution to eliminate such warnings would require parsing of
C source code. I don't think it make sense to invest time into it to
just to remove warnings.
------------------------------------------------------------------------
[2009-04-05 17:23:52] pierre dot php at gmail dot com
Description:
------------
zend\zend_vm_execute.h(17488) : warning C4101: 'free_op1' :
unreferenced local variable
dozen of times, the generation script could be fixed to silent them.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47902&edit=1