From 676e8fc1ba927dc84df82b508d796e31d9fd120c Mon Sep 17 00:00:00 2001 From: Felix Herrmann Date: Mon, 13 Jan 2020 10:40:25 +0100 Subject: fix some gcc9 compiler warnings Many stringop-truncation and stringop-overflow warnings are still there (so many). https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/ Signed-off-by: Felix Herrmann Signed-off-by: KHANH LUONG HONG DUY --- src/shared/dlt_common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/shared/dlt_common.c') diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c index 642d43d..670b01b 100644 --- a/src/shared/dlt_common.c +++ b/src/shared/dlt_common.c @@ -3042,21 +3042,22 @@ void dlt_get_version(char *buf, size_t size) return; } +/* Clang does not like these macros, because they are not reproducable */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdate-time" snprintf(buf, size, "DLT Package Version: %s %s, Package Revision: %s, build on %s %s\n%s %s %s %s\n", _DLT_PACKAGE_VERSION, _DLT_PACKAGE_VERSION_STATE, _DLT_PACKAGE_REVISION, -/* Clang does not like these macros, because they are not reproducable */ -#pragma clang diagnostic ignored "-Wdate-time" __DATE__, __TIME__, -#pragma clang diagnostic error "-Wdate-time" _DLT_SYSTEMD_ENABLE, _DLT_SYSTEMD_WATCHDOG_ENABLE, _DLT_TEST_ENABLE, _DLT_SHM_ENABLE); +#pragma GCC diagnostic pop } void dlt_get_major_version(char *buf, size_t size) -- cgit v1.2.1