From d5d03cd8ded5a7f4f2be3c0b4038da65c01b0bf7 Mon Sep 17 00:00:00 2001 From: Qyriad Date: Wed, 26 Nov 2025 12:17:18 +0100 Subject: [PATCH] undefined behavior: -Wembedded-directive warning: embedding a directive within macro arguments has undefined behavior ????? CLANG? why does this take -pedantic to show?? Change-Id: I6f4a9f3db1b89448f9f5d00d82b551e46a6a6964 --- meson.build | 2 ++ tests/unit/libstore/serve-protocol.cc | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index bede78a64..18bdc98b9 100644 --- a/meson.build +++ b/meson.build @@ -586,6 +586,8 @@ add_project_arguments( '-Wdeprecated-copy', '-Wignored-qualifiers', '-Werror=suggest-override', + # Undefined behavior. + '-Werror=embedded-directive', # don't let nlohmann automatically cast enums to ints. we don't set this # inside libutil headers to not force this behavior on users of libutil. '-DJSON_DISABLE_ENUM_SERIALIZATION=1', diff --git a/tests/unit/libstore/serve-protocol.cc b/tests/unit/libstore/serve-protocol.cc index c3638f898..c85767196 100644 --- a/tests/unit/libstore/serve-protocol.cc +++ b/tests/unit/libstore/serve-protocol.cc @@ -212,13 +212,11 @@ VERSIONED_CHARACTERIZATION_TEST( }, .startTime = 30, .stopTime = 50, -#if 0 // These fields are not yet serialized. // FIXME Include in next version of protocol or document // why they are skipped. - .cpuUser = std::chrono::milliseconds(500s), - .cpuSystem = std::chrono::milliseconds(604s), -#endif + // .cpuUser = std::chrono::milliseconds(500s), + // .cpuSystem = std::chrono::milliseconds(604s), }, }; t;