bugGNU source-highlight - Bugs: bug #48053, source-highlight 3.17+ fails to...


bug #48053: source-highlight 3.17+ fails to build with GCC-6 or with any dialect >= c++11

Submitted by:  Peter Levine <nsane457>
Submitted on:  Mon 30 May 2016 04:00:32 AM UTC  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Sat 01 Jun 2019 02:58:13 PM UTC, comment #2: 

Reported as fixed.

Tom Tromey <tromey>
Project Administrator
Mon 03 Jul 2017 04:52:29 AM UTC, comment #1: 

Sorry.  Didn't notice that this was already fixed with  http://git.savannah.gnu.org/cgit/src-highlite.git/commit/configure.ac?id=fa34f435776a40b26b18d1efb697d6441a076f51

Disregard the bug report.

Peter Levine <nsane457>
Mon 30 May 2016 04:00:32 AM UTC, original submission:  

Compiling with gcc-6 fails with:

./stdbool.h:112:70: error: expected ';', identifier or '(' before '_Bool'  typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;

Any dialect >= c++11 is not supposed to define bool, true or false as macros (see https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02594.html)

Also, there are several lines in lib/srchilite/settings.cpp that contain something like:

ifstream i(file.c_str());
return (i != 0);

which leads to something like:

No match for 'operator!=' (operand types are 'std::ifstream' and 'int')

In gcc-6, checking for stream errors this way is no longer allowed.  GCC suggest instead of "if (i != 0)" just do "if (i)".  But since this is in a return statement it appears an explicit cast to bool was also necessary (see https://gcc.gnu.org/gcc-6/porting_to.html).

Peter Levine <nsane457>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by tromey (Posted a comment)
  • -email is unavailable- added by nsane457 (Submitted the item)
  • -email is unavailable- added by nsane457
  • -email is unavailable- added by nsane457

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-06-01 tromey Open/ClosedOpen => Closed
    2016-05-30 nsane457 Attached File- => Added source-highlight-3.1.7-cpp11-gcc6.patch, #37305
        Carbon-Copy- => Added bug-source-highlight@gnu.org
        Carbon-Copy- => Added nsane457

    Back to the top

    Powered by Savane 3.5