Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-893

[HP aCC 6.16] bogus warning #20200 on enum and case/switch

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • External
    • None
    • aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007]

    • Incorrect Behavior

    Description

      The warning below is bogus since all possible values of x are being handled in the switch statement:

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

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sebor Martin Sebor
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: