Activity for dcb

  • dcb dcb posted a comment on discussion General Discussion

    Given this C++ code: include <string></string> include <vector></vector> using namespace std; void f( string a) { } void g( vector < string > b) { } then cppcheck says the same thing for both functions: apr18b.cc:9:16: performance: Function parameter 'a' should be passed by const reference. [passedByValue] void f( string a) ^ apr18b.cc:13:27: performance: Function parameter 'b' should be passed by const reference. [passedByValue] void g( vector < string > b) Since copying a vector of strings will...

  • dcb dcb posted a comment on discussion Development

    Option 2, please. I am happy to report bugs, but I don't do pull requests.

  • dcb dcb posted a comment on discussion Development

    I found a message that looks slightly wrong. trunk $ grep "There was critical" lib/*.cpp lib/checkersreport.cpp: fout << "There was critical errors (" << criticalErrors << ")" << std::endl; trunk $ In proper English, "There was" with plurals should be "There were".

  • dcb dcb posted a comment on ticket #46

    Hello there, The bug remains unfixed after three years, so I won't bother resubmitting it. Regards David Binderman From: bugs@tn5250.p.re.sourceforge.net bugs@tn5250.p.re.sourceforge.net on behalf of Kevin Adler kadler@users.sourceforge.net Sent: 17 October 2023 13:14 To: [tn5250:bugs] 46@bugs.tn5250.p.re.sourceforge.net Subject: [tn5250:bugs] #46 session.c:2949: bad compare ? status: open --> wont-fix Comment: Hi, if you are still experiencing this problem, please open an issue at https://github.com/tn5250/tn5250/issues...

  • dcb dcb posted a comment on ticket #46

    The bug remains unfixed after three years, so it seems pretty pointless to resubmit it. A fix looks unlikely.

  • dcb dcb posted a comment on discussion Development

    I haven't seen your CI before, so it can be no surprise that I see no evidence of a build by gcc or clang from today in it. I tried a git pull, just in case something had changed during the day. It didn't help. I have a self generated fix, so cppcheck builds for me here. I think that's about as far as I want to go with this. Thanks for your help.

  • dcb dcb posted a comment on discussion Development

    $ git diff lib/settings.cpp diff --git a/lib/settings.cpp b/lib/settings.cpp index 896341a..7b62612 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -24,6 +24,7 @@ #include <fstream></fstream> #include "json.h" +#include "timer.h" std::atomic<bool> Settings::mTerminated;</bool> So I think lib/settings.cpp is up to date. In your CI, which C++ compiler do you use ? Perhaps Microsoft ?

  • dcb dcb posted a comment on discussion Development

    Yesterday's cppcheck built fine. Not today. A compile error about SHOWTIME_NONE lib/settings.cpp: In constructor ‘Settings::Settings()’: lib/settings.cpp:69:30: error: ‘SHOWTIME_NONE’ is not a member of ‘SHOWTIME_MODES’ 69 | showtime(SHOWTIME_MODES::SHOWTIME_NONE), | ^~~~~~~~~~~~~ clang and g++ refuse to compile it, so I have no idea which compiler accepted the code. I ran the preprocessor only and grepped for SHOWTIME: $ grep SHOWTIME /tmp/q.ii enum class SHOWTIME_MODES; SHOWTIME_MODES showtime{};...

  • dcb dcb posted a comment on discussion General Discussion

    The following warnings are produced from a recent trunk version of gcc: lib/keywords.cpp:165:1: warning: control reaches end of non-void function [-Wreturn-type] lib/keywords.cpp:184:1: warning: control reaches end of non-void function [-Wreturn-type] lib/keywords.cpp:200:1: warning: control reaches end of non-void function [-Wreturn-type] lib/keywords.cpp:220:1: warning: control reaches end of non-void function [-Wreturn-type] externals/picojson/picojson.h:249:10: warning: ‘<unnamed>.picojson::value::u_’...

  • dcb dcb posted a comment on discussion General Discussion

    lib/checkcondition.cpp:490:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical] lib/checkcondition.cpp:552:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical] lib/checkcondition.cpp:814:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical] lib/checkcondition.cpp:829:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical] lib/checkcondition.cpp:844:9: warning: use of bitwise '&'...

  • dcb dcb posted a comment on discussion General Discussion

    apply the changes in PR 5015? Yes and the changes make it work for both gcc and clang. Thanks very much ! Some warnings were produced, I will make those the subject of another thread.

  • dcb dcb posted a comment on discussion General Discussion

    Two workarounds: The static assert went into gcc trunk on 2022-12-14, so use a compiler from before then. 20221204 seems to work. More brutally, remove the static assert from the alloc_traits.h header file. This will affect other builds.

  • dcb dcb posted a comment on discussion General Discussion

    Do you see some bleeding edge C++ code? Yes, use of lambdas. They have only been around since C++11 and have been enhanced ever since (C++14, C++17). That's probably ok if cppcheck only had to work with one compiler. I'd be interested to find out which C++ compiler accepts the current cppcheck code. MS maybe ?

  • dcb dcb posted a comment on discussion General Discussion

    Thanks for the information. Given that cppcheck has to compile with a variety of C++ compilers, I'd be tempted to rework the cppcheck code into something most C++ compilers can easily accept. Writing bleeding edge C++ code that some compilers have trouble implementing is IMHO asking for trouble.

  • dcb dcb posted a comment on discussion General Discussion

    Fedora 38 has been released with new gcc-13. Some newish C++ syntax for lambdas in the source code of cppcheck doesn't compile. /usr/include/c++/13/bits/alloc_traits.h: In instantiation of ‘struct std::__allocator_traits_base::__rebind<taggedallocator\<referencetoken, 3="">, ReferenceToken, void>’: /usr/include/c++/13/bits/alloc_traits.h:94:11: required by substitution of ‘template<class _alloc,="" class="" _up=""> using std::__alloc_rebind = typename std::__allocator_traits_base::__rebind<_Alloc,...

  • dcb dcb created ticket #962

    shk.c:4733: bad precedence ?

  • dcb dcb created ticket #75

    path_utils.c:89: possible bad precedence ?

  • dcb dcb created ticket #94

    strings.c:273: possible missing comma ?

  • dcb dcb created ticket #21

    icns2png.c:70: possible missing "," ?

  • dcb dcb created ticket #11

    ixpm.c: 2 * off by one error ?

  • dcb dcb posted a comment on discussion General Discussion

    I just tried to compile today's trunk cppcheck with new C/C++ compiler clang-14. It said: $ fgrep warning: mk.clang.out lib/checkcondition.cpp:477:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical] lib/checkcondition.cpp:538:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical] lib/checkcondition.cpp:804:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical] lib/checkcondition.cpp:819:9: warning: use of bitwise...

  • dcb dcb created ticket #343

    GContainer.h:860: bad call to memset ?

  • dcb dcb created ticket #341

    GBitmap.cpp:102:55: warning: member ' DJVU::GBitmap::bytes_data' is used uninitialized [-Wuninitialized]

  • dcb dcb created ticket #231

    ArchiveCommandLine.cpp:396:10: warning: duplicated 'if' condition

  • dcb dcb created ticket #257

    genlex.c:2435:18: warning: dup licated 'if' condition

  • dcb dcb created ticket #2469

    save.c:525:37: warning: duplicated ‘if’ condition

  • dcb dcb created ticket #237

    src/tuxpaint.c:3311: duplicate condition ?

  • dcb dcb created ticket #8

    sbr_dec.c:484: wrong buffer size ?

  • dcb dcb posted a comment on ticket #11

    It looks to me like your most recent code is irrelevant to the point I was trying to make. My apologies for the confusion. AFAIK, the casts in the original code don't affect anything. The code is essentially bool DataBase::IsValid() { if (something) return IsValid(); else return IsValid(); } which is why the clang compiler is getting upset. After this many years, however broken the code may or not be, you clearly aren't that bothered about fixing it, so it looks to me like continuing to find bugs...

  • dcb dcb created ticket #15

    Filetypes.cpp:363: infinite-recursion

  • dcb dcb posted a comment on ticket #1588

    I had a quick look at the new code and the thought struck me that if the event list is sorted on time and there are more than a few events in the list, then binary search would be faster than serial search. I am not sure where the breakeven point is, but it might be as few as 10 events. Just an idea.

  • dcb dcb created ticket #1588

    src/gui/editors/eventlist/EventView.cpp:676: suspicious if ?

  • dcb dcb created ticket #46

    session.c:2949: bad compare ?

  • dcb dcb created ticket #25

    asn_bits.c:348: bad compare ?

  • dcb dcb posted a comment on discussion General Discussion

    It works fine with --inconclusive flag. $ /home/dcb/cppcheck/trunk/cppcheck --enable=all --inconclusive may8e.cc may8e.cc:14:6: style:inconclusive: Technically the member function 'S::getFred' can be const. [functionConst] int getFred() { return fred; }; ^ may8e.cc:14:0: style: The function 'getFred' is never used. [unusedFunction] ^ $ Fast work. Thanks very much for your help.

  • dcb dcb posted a comment on discussion General Discussion

    For this C++ source code: class S { private: int fred; public: S( int n) : fred( n) { }; ~S() {}; int getFred() { return fred; }; }; where the member function body is only a return statement and so the member function could be made const, cppcheck doesn't detect this situation. $ /home/dcb/cppcheck/trunk/cppcheck --enable=all may8e.cc may8e.cc:14:0: style: The function 'getFred' is never used. [unusedFunction] $ I am not sure if this is a feature request or a bug report.

  • dcb dcb created ticket #91

    strings.c: 2 * bad test

  • dcb dcb created ticket #2209

    gnuplot-5.2.7/src/readline.c:455: possible missing break ?

  • dcb dcb created ticket #6

    run.c:1626: suspicious assignment

  • dcb dcb created ticket #8

    gtkdatabox_ruler.c: 3 * possible bad use of '&' ?

  • dcb dcb posted a comment on ticket #722

    Like which tool is generating this errors? cppcheck. From sourceforge. Recommended for all C/C++ code.

  • dcb dcb created ticket #722

    directorymonitor.cpp:363: bad erase ?

  • dcb dcb created ticket #12

    event_zone.cc:71]: (warning) Member variable 'event_zone::active' is not assigned a value

  • dcb dcb created ticket #15

    netsys_c_mem.c:1252: pointless call to strcmp ?

  • dcb dcb created ticket #102

    gtkiconlist.c: src and dest on sprintf can't match

  • dcb dcb created ticket #7

    arcmisc.c:131]: (error) Resource leak: old

  • dcb dcb created ticket #229

    tilp_config.c:235]: (error) Resource leak: txt

  • dcb dcb created ticket #163

    slpd_main.c:366]: (error) Resource leak: fd

  • dcb dcb created ticket #1997

    sahpi_gcrypt_utils.c:232]: (error) Resource leak: fconf

  • dcb dcb created ticket #6

    AuErrDes.c:177]: (error) Resource leak: fp

  • dcb dcb created ticket #4

    5 * missing return statements

  • dcb dcb created ticket #163

    libmpeg3/mpeg3title.c:194: bad call to fprintf ?

  • dcb dcb created ticket #162

    plugins/hyperlapse/hyperlapse.C:59: bad compares ?

  • dcb dcb posted a comment on ticket #733

    Three year old compiler is very old. Current released version of gcc is 7.2 - I am using 8.0 (development snapshot). Suggest upgrade, if you can.

  • dcb dcb created ticket #733

    history.c: 3 * bad memset size ?

  • dcb dcb created ticket #34

    eval.c:466: suspicious assignment ?

  • dcb dcb created ticket #26

    popupmenu.cc:979: bad type ?

  • dcb dcb created ticket #8

    RunParameters.cpp:270: bad type ?

  • dcb dcb created ticket #161

    src/svf/svf.c:1314: bad if ?

  • dcb dcb created ticket #71

    ADM_videoFilters/BlendRemover/ADM_vidBlendRemoval.cpp:151: bad compare ?

  • dcb dcb created ticket #33

    eval.c:438]: (warning) Redundant assignment

  • dcb dcb posted a comment on ticket #1981

    I'd done worse than that: I've emailed Keiichi Tokuda ( the maintainer) with the bug report. Let's see if they can come up with a reasonable fix.

  • dcb dcb created ticket #1981

    3rdparty/hts_engine_API/lib/HTS_model.c:1168: bad compare ?

  • dcb dcb created ticket #38

    rcfile.c:152: bad width ?

  • dcb dcb created ticket #73

    zip.cpp: 9 * bad catch type ?

  • dcb dcb created ticket #26

    2 * bad catch type ?

  • dcb dcb created ticket #3

    Aiksaurus.cpp: 4 * bad catch ?

  • dcb dcb created ticket #707

    backend_shinkos1245.c:500:27: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context]

  • dcb dcb created ticket #1

    test6.c: 6 * possible faulty expression ?

  • dcb dcb created ticket #1934

    CellBuffer.cxx: 2 * badly placed sanity check ?

  • dcb dcb created ticket #223

    Ft/Xml/src/domlette/content_model.c:356: read bad data ?

  • dcb dcb created ticket #866

    icon-theme.c:174: broken code ?

  • dcb dcb created ticket #37

    DivFix++.cpp:37: ordering mixup ?

  • dcb dcb created ticket #15

    utimecmp.c: 2* bad operator on bool value ?

  • dcb dcb posted a comment on discussion Help

    fedora/pass20/20170109/splix.spec.out:src/cache.cpp:245:25: warning: '~' on an expression...

  • dcb dcb created ticket #21

    src/heapy/hv_cli_findex.c:102: bad if statement ?

  • dcb dcb created ticket #7

    iptc-data.c:607: poor error checking ?

  • dcb dcb created ticket #35

    qjackctlSetupForm.cpp:835: possible missing break ?

  • dcb dcb created ticket #40

    ngrep.c: multiple missing breaks ?

  • dcb dcb created ticket #16

    c_src/esdl_video.c:169: possible missing break ?

  • dcb dcb created ticket #5

    genpictex.c:399: bad if test ?

  • dcb dcb created ticket #4

    acpi.h:22: bad header guard ?

  • dcb dcb created ticket #136

    tinyxml.h:353: sanity check wrong way around ?

  • dcb dcb created ticket #297

    gpdis.c:632: bad if test ?

  • dcb dcb created ticket #14

    memory leaks ?

  • dcb dcb created ticket #8

    four memory leaks ?

  • dcb dcb created ticket #95

    src/base64.c:212]: (error) Memory leak: outbuf

  • dcb dcb created ticket #215

    rtfconvert.c: 2 * possible botch in sizeof ?

  • dcb dcb created ticket #3

    sliding_window.c: 2 * undefined code ?

  • dcb dcb created ticket #202

    test-pdc.h:92: bad sizeof ?

  • dcb dcb created ticket #222

    qtractorDssiPlugin.h:22: bad macro ?

  • dcb dcb created ticket #6

    nativebarclient.h:19: bad macro ?

  • dcb dcb created ticket #22

    httpencode.cpp:62: cart before the horse ?

  • dcb dcb created ticket #116

    db_x509.cpp:521]: (error) Mismatching allocation and deallocation: cert

  • dcb dcb created ticket #13

    | and || mixup ?

  • dcb dcb created ticket #150

    bltUnixDnd.c:1251]: (style) Same expression on both sides of '&&'

  • dcb dcb created ticket #10

    system.c:3686]: (error) Resource leak: fp

  • dcb dcb created ticket #10

    include/cddb/cddb_log.h:22: bad define ?

  • dcb dcb created ticket #84

    source/expression_filter.cpp: 2* bad expression ?

1 >
MongoDB Logo MongoDB