This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14519] New: returning pointer to local function argument does not warn
- From: "jhaltom at feedbackplusinc dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Mar 2004 01:55:48 -0000
- Subject: [Bug c/14519] New: returning pointer to local function argument does not warn
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
int* function(int a)
{
return &a;
}
this, with -Wall should print a warning about not being able to return the
address of a local variable. The following DOES work properly.
int* function()
{
int i = 5;
return &i;
}
--
Summary: returning pointer to local function argument does not
warn
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jhaltom at feedbackplusinc dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14519