fmtlib / fmt

A modern formatting library
https://fmt.dev
Other
20.74k stars 2.49k forks source link

MSVC compiler dll export warning 4275 with format_error #3424

Closed ToddWilsonBertec closed 1 year ago

ToddWilsonBertec commented 1 year ago

Previously, the macro FMT_CLASS_API was suppressing the 4275 warning message when format_error was declared. Since this has been removed, the format_error decl vomits a bunch of warnings when compiled with MSVC.

To fix, change:

class FMT_API format_error : public std::runtime_error {

to

class FMT_API format_error : FMT_MSC_WARNING( suppress : 4275 ) public std::runtime_error {

vitaut commented 1 year ago

I don't think format_error even needs to be exported considering that it doesn't have any methods of its own. We could probably drop FMT_API from it.

vitaut commented 1 year ago

Should be worked around in https://github.com/fmtlib/fmt/commit/e0fc0e85e31b457b9687dd495cc5587ae5ff6caa.