From issues-return-1065-apmail-stdcxx-issues-archive=stdcxx.apache.org@stdcxx.apache.org Wed Apr 02 19:55:53 2008 Return-Path: Delivered-To: apmail-stdcxx-issues-archive@locus.apache.org Received: (qmail 29104 invoked from network); 2 Apr 2008 19:55:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Apr 2008 19:55:52 -0000 Received: (qmail 8011 invoked by uid 500); 2 Apr 2008 19:55:52 -0000 Delivered-To: apmail-stdcxx-issues-archive@stdcxx.apache.org Received: (qmail 7996 invoked by uid 500); 2 Apr 2008 19:55:52 -0000 Mailing-List: contact issues-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list issues@stdcxx.apache.org Received: (qmail 7951 invoked by uid 99); 2 Apr 2008 19:55:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 12:55:52 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Apr 2008 19:55:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6928C234C0BD for ; Wed, 2 Apr 2008 12:53:24 -0700 (PDT) Message-ID: <1326226442.1207166004429.JavaMail.jira@brutus> Date: Wed, 2 Apr 2008 12:53:24 -0700 (PDT) From: "Travis Vitek (JIRA)" To: issues@stdcxx.apache.org Subject: [jira] Commented: (STDCXX-751) [HP aCC 6.16] Potential null pointer dereference in locale_stub.cpp In-Reply-To: <1902284913.1205439744565.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STDCXX-751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584743#action_12584743 ] Travis Vitek commented on STDCXX-751: ------------------------------------- This is another bogus cadvise warning. Here is a simple testcase that shows... {noformat} #include #include int main (int argc, char* argv []) { const char* slash = strrchr (argv [0], '/'); if (!slash) slash = strrchr (argv [0], '\\'); printf ("%s\n", slash ? slash : argv [0]); return 0; } {noformat} I get the same warning if I replace {{?:}} with a regular conditional... {noformat} if (!slash) slash = argv [0]; printf ("%s\n", slash); {noformat} Heck, even this failed {noformat} const char* prog = argv [0]; if (slash) prog = slash; printf ("%s\n", prog); {noformat} Fortunately, or perhaps unfortunately, I did find that dereferencing the pointer inside the conditional seems to eliminate the warning... {noformat} if (slash) printf ("%s\n", slash); else printf ("%s\n", argv [0]); {noformat} Now this makes me wonder if I should even bother making a fix. This warning is obviously bogus. I suppose the value of fixing it is that we won't have to re-examine the issue if HP doesn't fix the warning by the time we do this type of testing again. The disadvantage would be that it makes the code a bit uglier. > [HP aCC 6.16] Potential null pointer dereference in locale_stub.cpp > ------------------------------------------------------------------- > > Key: STDCXX-751 > URL: https://issues.apache.org/jira/browse/STDCXX-751 > Project: C++ Standard Library > Issue Type: Sub-task > Components: 20. General Utilities > Affects Versions: 4.2.0 > Environment: $ uname -sr && aCC -V > HP-UX B.11.31 > aCC: HP C/aC++ B3910B A.06.16 [Nov 26 2007] > Reporter: Scott (Yu) Zhong > Assignee: Travis Vitek > Fix For: 4.2.1 > > Original Estimate: 2h > Remaining Estimate: 2h > > aCC -c -mt -I/amd/devco/scottz/stdcxx/4.2.x/include -I/build/scottz/12d/include -AA +O2 +DD64 +w +W392 +W655 +W684 +W818 +W819 +W849 +W2193 > +W2236 +W2261 +W2340 +W2401 +W2487 +W4227 +W4229 +W4231 +W4235 +W4237 +W4249 +W4255 +W4272 +W4284 +W4285 +W4286 /amd/devco/scottz/stdcxx/4.2.x/u > til/locale_stub.cpp > "/amd/devco/scottz/stdcxx/4.2.x/util/locale_stub.cpp", line 62, procedure main: warning #20200-D: Potential null pointer dereference through return of call to strrchr is detected (null definition:/amd/packages/mdx/hpux/ia64/aCC/6_16/opt/aCC/include_std/cstring, line 59) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.