stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Created: (STDCXX-893) [HP aCC 6.16] bogus warning #20200 on enum and case/switch
Date Wed, 23 Apr 2008 21:43:22 GMT
[HP aCC 6.16] bogus warning #20200 on enum and case/switch
----------------------------------------------------------

                 Key: STDCXX-893
                 URL: https://issues.apache.org/jira/browse/STDCXX-893
             Project: C++ Standard Library
          Issue Type: Bug
          Components: External
         Environment: aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]
            Reporter: Martin Sebor


The warning below is bogus since all possible values of x are being handled in the switch
statement:
{noformat}
$ cat t.cpp && aCC +w -c -V t.cpp
enum E { e, f };

int foo (E x)
{
    const char *s = 0;

    switch (x) {
    case e: s = "e"; break;
    case f: s = "f"; break;
    }

    return *s;
}

aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]
"t.cpp", line 12, procedure foo: warning #20200-D: Potential null pointer
          dereference through s is detected (null definition:t.cpp, line 5)
{noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message