BOUT-dev icon indicating copy to clipboard operation
BOUT-dev copied to clipboard

Lots of warnings from fmt with gcc 13

Open ZedThree opened this issue 1 year ago • 1 comments

GCC 13 generates lots of warnings from libfmt: warning: possibly dangling reference to a temporary [-Wdangling-reference]. This isn't anything we can directly fix ourselves.

In CMake 3.25, however, there is a SYSTEM argument to add_subdirectory that should silence these warnings.

We could add this without requiring CMake >= 3.25, because the second argument to add_subdirectory is binary_dir, meaning that:

  add_subdirectory(externalpackages/fmt SYSTEM)

will put the fmt built files (mostly just CMake stuff) in <build dir>/SYSTEM.

Is this too weird? Options are:

  1. add SYSTEM and require CMake >= 3.25
  2. add SYSTEM only
  3. do nothing and hope either gcc/fmt fix the issue

ZedThree avatar Apr 26 '23 14:04 ZedThree

Remove fmt from the subdirectory and instead switch to an installer for BOUT++, that installs fmt for us.

Using an installed fmt, there are no warnings ...

dschwoerer avatar May 03 '23 09:05 dschwoerer