Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Alpha on May 12, 2012, 03:35:10 pm

Title: CPPCheck bug fix
Post by: Alpha on May 12, 2012, 03:35:10 pm
I am not trying to seem pushy, but could a developer be convinced to look at Patch #3285 (http://developer.berlios.de/patch/?func=detailpatch&patch_id=3285&group_id=5358)?  It is rather embarrassing that I submitted the code with the bug in it :-[, and that it somehow passed all my testcases ???.  (The fix is rather simple, as the problem was a switched call to a string function, so it should not take much time to go through.)
Title: Re: CPPCheck bug fix
Post by: oBFusCATed on May 12, 2012, 05:32:16 pm
Provide a patch with wxString::Endswith in it and I'll commit it.

http://docs.wxwidgets.org/stable/wx_wxstring.html#wxstringendswith
Title: Re: CPPCheck bug fix
Post by: Alpha on May 12, 2012, 07:27:43 pm
Provide a patch with wxString::Endswith in it and I'll commit it.
New patch uploaded (and tested much more thoroughly).

In testing, I noticed that if the active build target is virtual, it may add include directories without replacing macros; this can fix it:
Code
Index: src/plugins/contrib/CppCheck/CppCheck.cpp
===================================================================
--- src/plugins/contrib/CppCheck/CppCheck.cpp   (revision 7965)
+++ src/plugins/contrib/CppCheck/CppCheck.cpp   (working copy)
@@ -236,6 +236,8 @@
         wxString IncludeDir(IncludeDirs[Dir]);
         if (target)
             MacrosMgr->ReplaceMacros(IncludeDir, target);
+        else
+            MacrosMgr->ReplaceMacros(IncludeDir);
         IncludeList += _T("-I\"") + IncludeDir + _T("\" ");
     }
     if (target)

Title: Re: CPPCheck bug fix
Post by: MortenMacFly on May 14, 2012, 09:04:16 am
In testing, I noticed that if the active build target is virtual, it may add include directories without replacing macros; this can fix it:
Applied in SVN. Thanks.