COIN-OR::LEMON - Graph Library

Opened 11 months ago

Last modified 4 months ago

#633 new defect

Fixes fox gcc 9

Reported by: Alpar Juttner Owned by: Alpar Juttner
Priority: blocker Milestone: LEMON 1.4 release
Component: core Version: hg main
Keywords: Cc:
Revision id:


The gcc 9.x report tons of warnings like

/home/alpar/projects/LEMON/hg/comptest-main/lemon/concepts/graph_components.h:527:15: error: implicitly-declared ‘lemon::concepts::Digraph::Node& lemon::concepts::Digraph::Node::operator=(const lemon::concepts::Digraph::Node&)’ is deprecated [-Werror=deprecated-copy]
  527 |           node=INVALID;
      |           ~~~~^~~~~~~~
In file included from /home/alpar/projects/LEMON/hg/comptest-main/test/
/home/alpar/projects/LEMON/hg/comptest-main/lemon/concepts/digraph.h:78:9: note: because ‘lemon::concepts::Digraph::Node’ has user-provided ‘lemon::concepts::Digraph::Node::Node(const lemon::concepts::Digraph::Node&)’
   78 |         Node(const Node&) { }
      |         ^~~~

The patch attached makes an attempt to fix it. Some of the changes, and event some of the related part of the current code is strange even for myself.

So this patch definitely needs a thorough review.

Attachments (1)

fix-gcc9.patch (13.7 KB) - added by Alpar Juttner 11 months ago.

Download all attachments as: .zip

Change History (4)

Changed 11 months ago by Alpar Juttner

Attachment: fix-gcc9.patch added

comment:1 Changed 11 months ago by Alpar Juttner

Priority: majorblocker

comment:2 Changed 11 months ago by Peter Kovacs

I checked the patch and here are some comments.

  • Most of the changes seems to be OK.
  • However, it is very strange that you made the assignment operator of NodeMap public in lemon/concepts/digraph.h. I checked the tests that require this change, but I think that those tests are actually wrong. As far as I remember, NodeMap objects cannot be copied with copy constructor and assignment operator, only using the map copy util methods. E.g. in dijkstra_test, the two assignments on L100 and L101 seems to be incorrect requirements: I would replace them with assignments of (const) references. And similarly in similar test files.
  • I don't really understand the changes related to RangeMap.

comment:3 Changed 4 months ago by Alpar Juttner

I have put this patch to main branch as [da87dbdf3daf], but leave the ticket open for further discussions.

Note: See TracTickets for help on using tickets.