Add LTTNG_PACKED ifdefs to validate that it is defined
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 26 Mar 2019 16:41:30 +0000 (12:41 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 26 Mar 2019 16:41:30 +0000 (12:41 -0400)
If LTTNG_PACKED is used to specify whether a structure is packed, but we
end up forgetting inclusion of lttng/ust-compiler.h (which defines it),
we end up silently _not_ packing the data structure, because
LTTNG_PACKED will be considered to be an identifier by the compiler,
and therefore simply ignored.

There are no such instances in lttng-ust, but let's add a ifdef check.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-abi.h
include/lttng/ust-ctl.h
include/lttng/ust-events.h
include/ust-comm.h
liblttng-ust/filter-bytecode.h

index 4976b1bf61ce4786c1288933e29f0f4dcb6fb315..01e9daf44a4dcf7f6915d3b20cc43a7b27ce2c8c 100644 (file)
 #include <stdint.h>
 #include <lttng/ust-compiler.h>
 
+#ifndef LTTNG_PACKED
+#error "LTTNG_PACKED should be defined"
+#endif
+
 #ifndef __ust_stringify
 #define __ust_stringify1(x)    #x
 #define __ust_stringify(x)     __ust_stringify1(x)
index f83124d11bbd9276100642dff9a4041a0ac892bc..57758edb19d15efe5032a5eebf4e4d3e1c1367b4 100644 (file)
 #include <sys/types.h>
 #include <limits.h>
 
+#ifndef LTTNG_PACKED
+#error "LTTNG_PACKED should be defined"
+#endif
+
 #ifndef LTTNG_UST_UUID_LEN
 #define LTTNG_UST_UUID_LEN     16
 #endif
index 902f2b2f24826ffdcff90b25afba079f6a1030aa..fefb8585536c6173e1d624954f58a8fba89421e9 100644 (file)
 #include <urcu/ref.h>
 #include <pthread.h>
 
+#ifndef LTTNG_PACKED
+#error "LTTNG_PACKED should be defined"
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index 6a08b306b1b9ade6b44cf722d8b3d26a73281600..10dbca2148c9e3f178c97517aa6cd501516b8099 100644 (file)
 #include <lttng/ust-ctl.h>
 #include <config.h>
 
+#ifndef LTTNG_PACKED
+#error "LTTNG_PACKED should be defined"
+#endif
+
 /*
  * Default timeout the application waits for the sessiond to send its
  * "register done" command. Can be overridden with the environment
index 9a2d4c0a0c04e454be39c96212620f60565237d3..7df0288ae071c46ecd6edb016b77a32fbd61d2c8 100644 (file)
 
 #include <lttng/ust-abi.h>
 
+#ifndef LTTNG_PACKED
+#error "LTTNG_PACKED should be defined"
+#endif
+
 /*
  * offsets are absolute from start of bytecode.
  */
This page took 0.026308 seconds and 4 git commands to generate.