This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/8045] Missing "unused variable" warning
- From: "flameeyes at gentoo dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 May 2008 16:31:36 -0000
- Subject: [Bug c++/8045] Missing "unused variable" warning
- References: <bug-8045-3310@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from flameeyes at gentoo dot org 2008-05-11 16:31 -------
I think this applies to 4.3 as well, as the following code does only warn in
the second function:
#include <stdlib.h>
#include <string.h>
char* oldstyle(const char *foo) {
size_t foolen;
if ( foo == NULL )
return NULL;
foolen = strlen(foo);
return strdup(foo);
}
char* newstyle(const char *foo) {
if ( foo == NULL )
return NULL;
const size_t foolen = strlen(foo);
return strdup(foo);
}
And I could really make use of such a warning in xine-lib's code :)
--
flameeyes at gentoo dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |flameeyes at gentoo dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8045