Skip to content

Error Ubuntu 19.10 compilation [-Werror=format-truncation=] #27

@josephmoresena

Description

@josephmoresena

I'm trying to compile ESIF_UF on Ubuntu 19.10 treated at Step 6 but I'm getting this error.
++++ ++++ ESIF_UF x64 Release Linux GMIN=1 ++++ gcc -c -Wno-multichar -Werror -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv -fstack-protector-strong -m64 -I../../ESIF_UF/Sources -I../../ESIF_CM/Sources -I../../ESIF_LIB/Sources -I../../../../Common -DESIF_ATTR_USER -DESIF_ATTR_DAEMON -DESIF_FEAT_OPT_COMPRESS -DESIF_ATTR_OS_LINUX -DESIF_ATTR_OS_LINUX_HAVE_READLINE -std=gnu99 -DESIF_FEAT_OPT_ACTION_SYSFS -o ../../ESIF_UF/Sources/lin/esif_uf_action_sysfs_os_lin.o ../../ESIF_UF/Sources/lin/esif_uf_action_sysfs_os_lin.c In file included from ../../../../Common/esif_ccb_string.h:72, from ../../../../Common/esif_ccb_library_lin_user.h:28, from ../../../../Common/esif_ccb_library.h:28, from ../../ESIF_CM/Sources/esif.h:194, from ../../ESIF_UF/Sources/esif_uf.h:22, from ../../ESIF_UF/Sources/lin/esif_uf_action_sysfs_os_lin.c:23: ../../ESIF_UF/Sources/lin/esif_uf_action_sysfs_os_lin.c: In function ‘ActionSysfsGet’: ../../../../Common/esif_ccb_string_lin_user.h:83:48: error: ‘%s’ directive output may be truncated writing up to 537 bytes into a region of size between 0 and 537 [-Werror=format-truncation=] 83 | #define esif_ccb_sprintf(siz, str, fmt, ...) esif_ccb_sprintf_len(siz, snprintf(str, siz, fmt, ##__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../ESIF_UF/Sources/lin/esif_uf_action_sysfs_os_lin.c:1340:2: note: in expansion of macro ‘esif_ccb_sprintf’ 1340 | esif_ccb_sprintf(MAX_SYSFS_PATH, cur_path, "%s/%s/power_limits", path, node); | ^~~~~~~~~~~~~~~~ In file included from /usr/include/stdio.h:867, from ../../../../Common/esif_ccb.h:90, from ../../../../Common/esif_sdk.h:56, from ../../ESIF_CM/Sources/esif.h:56, from ../../ESIF_UF/Sources/esif_uf.h:22, from ../../ESIF_UF/Sources/lin/esif_uf_action_sysfs_os_lin.c:23: /usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 15 and 1089 bytes into a destination of size 538 67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 68 | __bos (__s), __fmt, __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make: *** [Makefile:190: ../../ESIF_UF/Sources/lin/esif_uf_action_sysfs_os_lin.o] Error 1

Searching into this repo I found that this error was fixed for Ubuntu 18.04 in f6983da but I'm still getting it on Ubuntu 19.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions