------- 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

Reply via email to