Copilot commented on code in PR #13310:
URL: https://github.com/apache/trafficserver/pull/13310#discussion_r3455478675
##########
include/tsutil/TsSharedMutex.h:
##########
@@ -27,6 +27,7 @@
#include <pthread.h>
#include "tsutil/Strerror.h"
#include "tsutil/Assert.h"
+#include "tsutil/ts_thread_safety.h"
Review Comment:
`TsSharedMutex.h` now includes `tsutil/ts_thread_safety.h`, but
`ts_thread_safety.h` is not listed in tsutil's installed/public headers
(TSUTIL_PUBLIC_HEADERS). This will break `cmake --install` / packaging because
the installed `TsSharedMutex.h` will include a header that wasn't installed.
##########
src/tsutil/CMakeLists.txt:
##########
@@ -80,9 +80,19 @@ if(BUILD_TESTING)
unit_tests/test_StringConvert.cc
unit_tests/test_Regex.cc
unit_tests/test_ts_meta.cc
+ unit_tests/test_thread_safety.cc
unit_tests/test_time_parser.cc
)
+ # The thread-safety test doubles as a compile-time check: under Clang, build
it
+ # with the analysis enabled and treat any finding as an error so a broken
+ # annotation chain fails the build. A no-op for GCC (the macros expand to
+ # nothing there).
+ set_source_files_properties(
+ unit_tests/test_thread_safety.cc PROPERTIES COMPILE_OPTIONS
+
"$<$<CXX_COMPILER_ID:Clang>:-Wthread-safety;-Werror=thread-safety>"
+ )
Review Comment:
The per-source COMPILE_OPTIONS generator expression contains a raw ';'. In
CMake, ';' is a list separator even inside quotes, so this will split into two
list items and leave a malformed generator expression (the trailing
`-Werror=thread-safety>` would be applied unconditionally and likely break
builds). Split the options into separate generator expressions (or escape the
';') so the expression remains valid.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]