Skip to content

Commit

Permalink
[vsf] fix compiler warnings for arm clang
Browse files Browse the repository at this point in the history
  • Loading branch information
versaloon committed Feb 18, 2023
1 parent ace9863 commit d4fb397
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/component/input/driver/hid/vsf_input_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ static vsf_err_t __vk_hid_parse_item(vk_input_hid_t *dev,
if (size == 1) {
value = *buf;
} else if (size == 2) {
value = *(uint16_t *)buf;
value = get_unaligned_le16(buf);
} else if (size == 4) {
value = *(uint32_t *)buf;
value = get_unaligned_le32(buf);
}

switch (tag) {
Expand Down
5 changes: 5 additions & 0 deletions source/kernel/__eda/vsf_eda_bmpevt.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ static void __vsf_eda_bmpevt_adapter_sync_evthander(vsf_eda_t *eda, vsf_evt_t ev
#if __IS_COMPILER_GCC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-align"
#elif __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wcast-align"
#endif

SECTION(".text.vsf.kernel.__vsf_eda_bmpevt_adapter_sync_init")
Expand Down Expand Up @@ -151,6 +154,8 @@ static vsf_err_t __vsf_eda_bmpevt_adapter_bmpevt_reset(vsf_bmpevt_adapter_t *thi
}
#if __IS_COMPILER_GCC__
# pragma GCC diagnostic pop
#elif __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
# pragma clang diagnostic pop
#endif

SECTION(".data.vsf.kernel.vsf_eda_bmpevt_adapter_bmpevt_op")
Expand Down
15 changes: 15 additions & 0 deletions source/shell/sys/linux/include/sys/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ struct cmsghdr {
int cmsg_level;
int cmsg_type;
};

#if __IS_COMPILER_GCC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-align"
#elif __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wcast-align"
#endif

static inline struct cmsghdr * CMSG_NXTHDR(struct msghdr *__msg, struct cmsghdr *__cmsg)
{
struct cmsghdr * __ptr;
Expand All @@ -172,6 +181,12 @@ static inline struct cmsghdr * CMSG_NXTHDR(struct msghdr *__msg, struct cmsghdr
return __ptr;
}

#if __IS_COMPILER_GCC__
# pragma GCC diagnostic pop
#elif __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
# pragma clang diagnostic pop
#endif

// how for shutdown
enum {
SHUT_RD = 1 << 0,
Expand Down
5 changes: 5 additions & 0 deletions source/shell/sys/linux/kernel/fs/vsf_linux_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
#if __IS_COMPILER_GCC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-align"
#elif __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wcast-align"
#endif

/*============================ MACROS ========================================*/
Expand Down Expand Up @@ -2702,6 +2705,8 @@ vsf_linux_fd_t * vsf_linux_tx_pipe(vsf_linux_pipe_rx_priv_t *priv_rx)

#if __IS_COMPILER_GCC__
# pragma GCC diagnostic pop
#elif __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
# pragma clang diagnostic pop
#endif

// term
Expand Down
5 changes: 5 additions & 0 deletions source/shell/sys/linux/port/busybox/busybox.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ extern int vsf_linux_init_main(int argc, char *argv[]);
#if __IS_COMPILER_GCC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-align"
#elif __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wcast-align"
#endif
WEAK(vsf_linux_init_main)
int vsf_linux_init_main(int argc, char *argv[])
Expand Down Expand Up @@ -73,6 +76,8 @@ int vsf_linux_init_main(int argc, char *argv[])
}
#if __IS_COMPILER_GCC__
# pragma GCC diagnostic pop
#elif __IS_COMPILER_LLVM__ || __IS_COMPILER_ARM_COMPILER_6__
# pragma clang diagnostic pop
#endif
#endif

Expand Down

0 comments on commit d4fb397

Please sign in to comment.