Menu

#25 Casting a function call to void breaks parser

Next_Release
fixed
ollydbg
Bug_Report
2019-02-11
2014-07-15
raynebc
No

When a function call's return value is cast to (void) in order to prevent a "return value unused warning", right clicking on the name of the function in that line of code and trying to find either the declaration or the implementation of that function reveals that the type cast has broken something in Code::Blocks and neither the declaration nor the implementation can be correctly found.

p2rkw submitted a patch back when I'd added this issue to the old bug tracker, but the problem persisted on the next nightly and every nightly I've tried including the most recent one (July 6, 2014).

Discussion

  • ollydbg

    ollydbg - 2014-07-16

    Hi, we can still use the old bug tracker, see: http://alpha0010.github.io/cb-history/
    I'm not sure which patch do I need to follow, thanks.

     
  • ollydbg

    ollydbg - 2014-07-16
    • labels: --> CodeCompletion
     
  • raynebc

    raynebc - 2014-07-16

    This was ticket #18862 on the old bug tracker, but I didn't find it on that archived mirror of the BerliOS tickets. Unfortunately the patch in question presumably did not resolve the issue or was never implemented because the problem never went away in any subsequent nightly releases.

    In case it was on the right track though, this was the patch p2rkw previously posted to the ticket on Jan 9, 2013:
    Index: src/plugins/codecompletion/parser/parserthread.cpp
    ===================================================================
    --- src/plugins/codecompletion/parser/parserthread.cpp (wersja 8771)
    +++ src/plugins/codecompletion/parser/parserthread.cpp (kopia robocza)
    @@ -1077,7 +1079,9 @@
    else if ( (peek == ParserConsts::semicolon)
    || ( ( m_Options.useBuffer
    && (peek.GetChar(0) == ParserConsts::opbracket_chr) )
    - && (!m_Str.Contains(ParserConsts::dcolon)) ) )
    + && (!m_Str.Contains(ParserConsts::dcolon))
    + && (!m_Str.Contains(ParserConsts::opbracket_chr))
    + && (!m_Str.Contains(ParserConsts::clbracket_chr)) ) )
    {
    if ( !m_Str.IsEmpty()
    && ( wxIsalpha(token.GetChar(0))
    ===================================================================

    You commented on that patch on Feb 22, so if it was committed to C::B's source code, it may have been around that time.

     
    • ollydbg

      ollydbg - 2014-07-17

      It is here: http://alpha0010.github.io/cb-history/bugs/18862.html
      Right?

      But I'm not really sure that checking m_Str contains both a "(" and ")" is enough and correct.

       
  • ollydbg

    ollydbg - 2014-07-17
    • assigned_to: ollydbg
     
  • Morten MacFly

    Morten MacFly - 2015-02-07
    • Type: --> Undefined
     
  • Teodor Petrov

    Teodor Petrov - 2016-01-21
    • Type: Undefined --> Bug_Report
     
  • ollydbg

    ollydbg - 2019-02-11
    • status: open --> fixed
     
  • ollydbg

    ollydbg - 2019-02-11

    Fixed in rev11567.

     
    👍
    1

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.