File tree 3 files changed +8
-1
lines changed
3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,9 @@ include(RDMA_DoFixup)
188
188
include (publish_headers)
189
189
include (rdma_functions)
190
190
include (pyverbs_functions)
191
+
192
+ check_c_compiler_flag("-Wcast-align=strict" HAVE_WCAST_ALIGN_STRICT)
193
+
191
194
if (NO_MAN_PAGES)
192
195
# define empty stub functions to omit man page processing
193
196
function (rdma_man_pages)
Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ add_library(ibverbs_tools STATIC
3
3
pingpong.c
4
4
)
5
5
6
+ if (HAVE_WCAST_ALIGN_STRICT)
7
+ target_compile_options (ibverbs_tools PRIVATE "-Wcast-align=strict" )
8
+ endif ()
9
+
6
10
rdma_executable(ibv_asyncwatch asyncwatch.c)
7
11
target_link_libraries (ibv_asyncwatch LINK_PRIVATE ibverbs)
8
12
Original file line number Diff line number Diff line change @@ -2220,7 +2220,7 @@ static inline struct verbs_context *verbs_get_ctx(struct ibv_context *ctx)
2220
2220
return NULL ;
2221
2221
2222
2222
/* open code container_of to not pollute the global namespace */
2223
- return (struct verbs_context *)(((uint8_t * )ctx) -
2223
+ return (struct verbs_context *)(((uintptr_t )ctx) -
2224
2224
offsetof (struct verbs_context ,
2225
2225
context));
2226
2226
}
You can’t perform that action at this time.
0 commit comments