Skip to content

1.5.1: FMT_STRING() breaks spdlog in Examples/ColourSpace/colourspace.cpp #236

@jfpanisset

Description

@jfpanisset

In 1.5.1 the calls to spdlog::info() wrap the string passed to spdlog in the FMT_STRING() macro.

On gcc 14.2.1 when spdlog() is called with a fstring-style string and variables, everything is fine:

spdlog::info(FMT_STRING("unknown colour management style '{}'"), style);

but when the string is a simple string without variable interpolation:

spdlog::info(FMT_STRING("Specifying preferred input colourspaces"));

the compiler rejects it, complaining about incomplete types.

I see this with spdlog 1.5.3 or 1.7.0, with either the corresponding fmt compiled separately, or using the one bundled in spdlog. Same issue if I patch CMakeLists.txt to force compiling in C++ 20 mode.

I am able to get around the issue with this gross patch:

// In some environments {fmt} needs FMT_STRING
//#ifndef FMT_STRING
#define FMT_STRING(x) x
//#endif

at the cost of gcc complaining about FMT_STRING being redifined.

I don't understand enough about spdlog, fmt or template metaprogramming to get at the root of the issue. I can provide more details on the errors reported by gcc if needed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions