Parent: b00bc612fab842def22d042bad8919213bcb9b1a
Author: Marcel Holtmann <marcel@holtmann.org>
Committer: Marcel Holtmann <marcel@holtmann.org>
Date: 2023-06-27 19:08:53
Tree: b14d42d473588063f4d614dce1789c95a17ad0c7
android: Fix compiler warning from GCC This ignores the following two warnings from the compiler. CC android/gatt.o android/gatt.c: In function ‘handle_client_register_for_notification’: android/gatt.c:3733:9: error: ‘memcpy’ offset [0, 16] is out of the bounds [0, 0] [-Werror=array-bounds=] 3733 | memcpy(¬ification->ch, &cmd->char_id, sizeof(notification->ch)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC android/gatt.o android/gatt.c: In function ‘handle_client_register_for_notification’: android/gatt.c:3735:9: error: ‘memcpy’ writing 17 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=] 3735 | memcpy(¬ification->ch, &cmd->char_id, sizeof(notification->ch)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It could be possible that these warnings are valid or they might be a false positive. However since this is Android based code based on Android HAL headers, just set pragma to ignore them.
Diffstat
| M | android/gatt.c | | | 4 | ++++ |
1 files changed, 4 insertions(+), 0 deletions(-)