Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
HP C/aC++ B3910B A.06.16 [Nov 26 2007]
-
Incorrect Behavior
Description
------- Original Message --------
Subject: aCC 6.16 bogus warning #20200 with +d on a conditional and for statement
Date: Tue, 18 Mar 2008 13:39:00 -0600
From: Martin Sebor <sebor@roguewave.com>
Organization: Rogue Wave Software, Inc.
To: acxx@cup.hp.com <acxx@cup.hp.com>
Here's another bogus warning #20200. This one goes away if I drop +d,
or the first call to strchr(), or use s directly instead of assigning
it to ss in the for loop.
Martin
$ cat u.cpp && aCC -V -c +d +w u.cpp #include <string.h> char *s; void foo () { if (s && strchr (s, 'x')) { for (const char *ss = s; *ss; ++ss) { ss = strchr (ss, 'x'); if (!ss) break; } } } aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007] "u.cpp", line 10, procedure foo: warning #20200-D: Potential null pointer dereference through ss is detected (null definition:u.cpp, line 10)
Attachments
Issue Links
- is depended upon by
-
STDCXX-745 [HP aCC 6.16] Potential null pointer dereference in locale_body.cpp
- Closed
-
STDCXX-746 [HP aCC 6.16] Potential null pointer dereference in locale_combine.cpp
- Closed
-
STDCXX-747 [HP aCC 6.16] Potential null pointer dereference in locale_name.cpp
- Closed