SciLexer.dll and recent MinGW; compiler problem

peterme
2013-08-26
2013-08-28
  • peterme
    peterme
    2013-08-26

    Hi,

    i tried to compile the SciLexer (from Scintilla 3.3.4, link is given within this group)
    using the recent MinGW as retrieved from mingw.org today
    and encountered problems at 8 files. Is there anybody who might give a little bit advice?
    --
    The first(and second) prob deals with missing d2d1.h included from ScintillaWin.cxx and Platwin.cxx
    - those ones could be hardcoded suppressed by: #undef USE_D2D
    But is that the right way?
    --
    The third one is about lexlib/Accessor.cxx resp. wordList.h:
    ../lexlib/WordList.h:35:7: error: extra qualification 'WordList::' SetWordAt' -fpermissive]
    How to solve that correctly?
    --
    The next ones are mainly dealing with lexUser.cxx;
    ../lexers/LexUser.cxx:1657:47: error: third operand to the conditional operatoris of type 'void', but the second operand is neither a throw-expression nor of type 'void'
    That refers to the following for-loop:
    for (; finished; dontMove?true:sc.Forward())
    Any hints?
    --
    About the subsequent ones later, if needed.

     
  • peterme
    peterme
    2013-08-27

    For #1 (error missing d2d1.h) there is a fix:
    https://sourceforge.net/p/scintilla/bugs/1519/
    --
    The other ones are introduced from Notepad++, not from Scintilla ....
    (as of comparison with the original delivery from scintilla).
    Any hints?

     
  • Loreia2
    Loreia2
    2013-08-28

    Hi peterme,

    about the LexUser errors:

    for (; finished; dontMove?true:sc.Forward())

    This is a bit of a hack, but Visual studio never complained about it(even with -W4 flag). The idea here is to move by one character in each loop, but to skip this call if algorithm already called sc.Forward() method.

    If you are having problem with this, please replace for loop with while loop.

    ../lexers/LexUser.cxx:933:25: error: '>>' should be '> >' within a nested template
    I remember older Visual studio version complaining about this, but not newer ones. So, just add space and be done with it.

    Probably recent gcc versions do not like this syntax; see here:
    http://compgroups.net/comp.lang.c++/minor-compiler-bug/1050777

    Seems that the expression need to be replaced by an if-else ??
    Strictly speaking, syntax is OK, but it would probably be wiser just to switch to while loop

    BR,
    Loreia

     
  • peterme
    peterme
    2013-08-28

    Hi Loreia,

    "just add space" -> yes, that was the fix proposal above, but the formatting stealed a little bit of the syntax :-/

    About the while loop insteead of the for loop:
    i'll open a ticket for those compiler issues, so that a solution for the recent mingw will be official.

    Best Regards!
    Peter