help-rcs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug c/14519] New: returning pointer to local function argument does not


From: jhaltom at feedbackplusinc dot com
Subject: [Bug c/14519] New: returning pointer to local function argument does not warn
Date: 11 Mar 2004 01:55:48 -0000

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]