ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
format.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Helper module for formatting text
4Author: Rafael Sá Menezes, rafael.sa.menezes@outlook.com
5
6\*******************************************************************/
7
8#pragma once
9#include <string>
10#include <type_traits>
12
14// Clang has no support for nonnull-compare warning
15#ifdef __GNUC__
16# ifndef __clang__ // For some reason clang also defines GNUC :)
17# pragma GCC diagnostic ignored "-Wnonnull-compare"
18# endif
19# pragma GCC diagnostic ignored "-Waddress"
20#endif
21
22#include <fmt/format.h>
24
25// fmt::underlying() was introduced in fmt 9.0.0 (FMT_VERSION >= 90000).
26// Provide a fallback for systems shipping older fmt (e.g. Ubuntu 22.04 / fmt
27// 8).
28#if !defined(FMT_VERSION) || FMT_VERSION < 90000
29namespace fmt
30{
31template <typename Enum>
32constexpr auto underlying(Enum e) -> std::underlying_type_t<Enum>
33{
34 return static_cast<std::underlying_type_t<Enum>>(e);
35}
36} // namespace fmt
37#endif
38
39#define ESBMC_FORMATS_START_ASSERTION
40
41// For more in-depth for how this specialization work look at
42// https://fmt.dev/latest/api.html#format-api
43
54
55#undef ESBMC_FORMATS_START_ASSERTION
#define CC_DIAGNOSTIC_PUSH()
Definition OM_compiler_defs.h:5
#define CC_DIAGNOSTIC_POP()
Definition OM_compiler_defs.h:6
Definition format.h:30
constexpr auto underlying(Enum e) -> std::underlying_type_t< Enum >
Definition format.h:32