Add IWYU keep pragmas when including some compat headers
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 11 Dec 2023 18:59:38 +0000 (13:59 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 14 Dec 2023 15:57:04 +0000 (10:57 -0500)
When editing some on Linux, IWYU and clangd report some inclusions of
`compat/endian.h`, for instance, as unused.   This is because this
header defines some macros only on systems that lack them, and Linux
isn't one of them.  These includes should not be removed, so add some
pragmas to let tools (and even humans) know that they are important.

Change-Id: Id2cba11a568567e6a75d094df3567b0847dac690
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11518
Tested-by: jenkins <jenkins@lttng.org>
src/cpp-common/endian.hpp
src/plugins/ctf/common/metadata/visitor-generate-ir.cpp
src/plugins/ctf/fs-sink/fs-sink-stream.cpp
src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.cpp
src/plugins/ctf/fs-src/data-stream-file.cpp
src/plugins/ctf/fs-src/lttng-index.hpp
src/plugins/ctf/lttng-live/data-stream.cpp
src/plugins/ctf/lttng-live/lttng-viewer-abi.hpp
src/plugins/ctf/lttng-live/viewer-connection.cpp

index 6d836ab4f62bacec7d19e7f4abb8726e86a8c5cc..a31e31ab5a447ae072a1a086e4da67897df24d9f 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <cstdint>
 
-#include "compat/endian.h"
+#include "compat/endian.h" /* IWYU pragma: keep  */
 
 namespace bt2_common {
 
index 50a8b541699acc6f8f563fe2843c5a9327e3d3bb..c53c4d8a3432c2f86e8790ed73bb78442e7da9c3 100644 (file)
@@ -27,7 +27,7 @@
 #include "common/assert.h"
 #include "common/common.h"
 #include "common/uuid.h"
-#include "compat/endian.h"
+#include "compat/endian.h" /* IWYU pragma: keep  */
 
 #include "ast.hpp"
 #include "ctf-meta-visitors.hpp"
index d56180b14ed7bb0819bc80da903df7077ee9bd7c..6611744b5b9c1acec87b6140fcaa0a55e81a5681 100644 (file)
@@ -15,7 +15,7 @@
 #include "logging/comp-logging.h"
 
 #include "common/assert.h"
-#include "compat/endian.h"
+#include "compat/endian.h" /* IWYU pragma: keep  */
 #include "ctfser/ctfser.h"
 
 #include "fs-sink-ctf-meta.hpp"
index a67796b8f103adb0514f903cb16ce033615b3235..85d8ccf9513a92c5cdc9412f6f319f28ac6fed3f 100644 (file)
@@ -10,7 +10,7 @@
 #include <babeltrace2/babeltrace.h>
 
 #include "common/assert.h"
-#include "compat/endian.h"
+#include "compat/endian.h" /* IWYU pragma: keep  */
 
 #include "fs-sink-ctf-meta.hpp"
 #include "translate-ctf-ir-to-tsdl.hpp"
index 698c0129439e27713a02874b39ec6ed3a9bf06a0..4a500221ec387c3369dbe14913562b1fa7a7a16f 100644 (file)
@@ -20,8 +20,8 @@
 #include "logging/comp-logging.h"
 
 #include "common/assert.h"
-#include "compat/endian.h"
-#include "compat/mman.h"
+#include "compat/endian.h" /* IWYU pragma: keep  */
+#include "compat/mman.h"   /* IWYU pragma: keep  */
 
 #include "../common/msg-iter/msg-iter.hpp"
 #include "data-stream-file.hpp"
index e07d87bc9d4789a2676a2972f010a8a1c1dd58c9..36dc7cc934d46366aa12ebf7b13f239e8699eacb 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <cstdint>
 
-#include "compat/limits.h"
+#include "compat/limits.h" /* IWYU pragma: keep  */
 
 #define CTF_INDEX_MAGIC    0xC1F1DCC1
 #define CTF_INDEX_MAJOR    1
index 9ad1e9ef8412186cb8ef465d75cbe5d873857492..4bba7ddb326ad9dfbb5108bdfaeb24838f6ff96d 100644 (file)
@@ -21,7 +21,7 @@
 #include "logging/comp-logging.h"
 
 #include "common/assert.h"
-#include "compat/mman.h"
+#include "compat/mman.h" /* IWYU pragma: keep  */
 
 #include "../common/msg-iter/msg-iter.hpp"
 #include "data-stream.hpp"
index f8ae6a21a8725ad91c9add72f23d40f347519bd2..bf9abae4297fc0549f3a0fd7b8211a7a5d20d6d0 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <stdint.h>
 
-#include "compat/limits.h"
+#include "compat/limits.h" /* IWYU pragma: keep  */
 
 #define LTTNG_VIEWER_PATH_MAX      4096
 #define LTTNG_VIEWER_NAME_MAX      255
index 02c7e6ace88794b303f1b45bbc844ebb0df1e2da..db5900af866e89a292aca85a31c751590af07baa 100644 (file)
@@ -17,8 +17,7 @@
 #include "logging/comp-logging.h"
 
 #include "common/common.h"
-#include "compat/endian.h"
-#include "compat/socket.h"
+#include "compat/endian.h" /* IWYU pragma: keep  */
 
 #include "data-stream.hpp"
 #include "lttng-live.hpp"
This page took 0.029288 seconds and 4 git commands to generate.