COIN-OR::LEMON - Graph Library

Opened 2 weeks ago

Closed 11 days ago

#615 closed defect (fixed)

Compilation warnings (unused local typedefs)

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

Description (last modified by Alpar Juttner)

Clang compiler version 5.0 reports tons of warnings of unused local typedefs. This renders the compilation unsuccessful in Maintainer mode.

We need a decision how to handle it.

  • The majority of these warnings comes from the *GRAPH_TYPEDEFS macros.
    • One way to avoid would be to suppress them to apply some compiler specific #pragma statement, but I have no idea how to do it safely and compiler independently. Can anyone help me in doing this? Is it possible to do it locally only for these typedefs?
    • The other solution is to use the ignore_unused() templates. The attaches chgset [0f291d5010f6] does this, but it is painful, because ignore_unused() cannot (and need not) be used in the global scope. Therefore we need to versions of all of these macros, one with the warning suppression, and one without. This is far from being convenient.
  • In addition, there are couple of standalone unused local typedefs, mainly in the test codes. What shall we do with them?
    • Use ignore_unused() for them?
    • Or delete them for they are unnecessary?
    • Or just comment them out and keep them for future reference?

Attachments (4)

0f291d5010f6.patch (34.6 KB) - added by Alpar Juttner 2 weeks ago.
d6aa3c2ec627.patch (2.7 KB) - added by Alpar Juttner 12 days ago.
9fb966ffce37.patch (9.7 KB) - added by Alpar Juttner 11 days ago.
615-f179aa1045a4.patch (9.8 KB) - added by Peter Kovacs 11 days ago.

Download all attachments as: .zip

Change History (12)

Changed 2 weeks ago by Alpar Juttner

Attachment: 0f291d5010f6.patch added

comment:1 Changed 2 weeks ago by Alpar Juttner

Description: modified (diff)

comment:2 Changed 2 weeks ago by Alpar Juttner

Description: modified (diff)

comment:3 Changed 2 weeks ago by Alpar Juttner

Priority: majorblocker

Changed 12 days ago by Alpar Juttner

Attachment: d6aa3c2ec627.patch added

comment:4 Changed 12 days ago by Alpar Juttner

The attached [d6aa3c2ec627] changeset is another proposal. It simply turns off the related warning globally in LEMON (and - of course - in all code that uses a lemon header).

It has already been there for Gcc versions >=4.8, now it is set for the Intel and Clang compilers, as well.

Could you please review this patch?

comment:5 Changed 12 days ago by Alpar Juttner

Description: modified (diff)

Changed 11 days ago by Alpar Juttner

Attachment: 9fb966ffce37.patch added

comment:6 Changed 11 days ago by Alpar Juttner

The attached changeset [9fb966ffce37] is another attempt. The Intel compiler seems to be very strict about unused variables.

Changed 11 days ago by Peter Kovacs

Attachment: 615-f179aa1045a4.patch added

comment:7 Changed 11 days ago by Peter Kovacs

I checked the patches, although I haven't tried them with Intel compiler.

I prefer the new approach, i.e. [9fb966ffce37], with a minor modification. I would omit the name of a function's parameter instead of using ignore_unused_variable_warning() where it is applicable (bfs.h, dfs.h, nagamochi_ibaraki.h). I attached the revised patch [f179aa1045a4].

Anyway, I could not import [9fb966ffce37] with --exact. (It may be the same issue as in e.g. #602).

comment:8 Changed 11 days ago by Alpar Juttner

Resolution: fixed
Status: newclosed

[f179aa1045a4] has been merged to both branches 1.3 and main.

Note: See TracTickets for help on using tickets.