From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Description of problem: ================================= foo.c ============================ #include <alloca.h> #include <string.h> #include <stdlib.h> extern void bar (char*, char*); void foo (const char *name, const char *type) { { size_t name_len = strlen (name); char *name_temp = (char *) alloca (name_len); if (name_len > 0) memcpy (name_temp, name, name_len); { char name_copy[name_len + 2]; memcpy (name_copy, name_temp, name_len); name_copy[name_len] = '$'; name_copy[name_len + 1] = '\0'; { size_t type_len = strlen (type); char *type_temp = (char *) alloca (type_len); if (type_len > 0) memcpy (type_temp, type, type_len); { char type_copy[type_len + 2]; memcpy (type_copy, type_temp, type_len); type_copy[type_len] = '$'; type_copy[type_len + 1] = '\0'; { bar (name_copy, type_copy); } } } } } } ================================= foo.c ============================ produces this warning: $ gcc -c foo.c foo.c: In function `foo': foo.c:21: warning: alloca()ed storage released along with dynamically-sized auto objects Version-Release number of selected component (if applicable): gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) How reproducible: Always Steps to Reproduce: 1.save file foo.c 2.gcc -c foo.c Actual Results: warning Expected Results: no warning Additional info: see also <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19881>
I have reverted the alloca warning patch for now in gcc-3.4.3-21. gcc-4.0.0-0.30 ATM in rawhide never had this patch in.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-257.html