Summary: | sys-devel/gcc-6.x[vtv]: fails to compile with -Werror=format-security in libvtv/vtv_rts.cc | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Thomas Deutschmann (RETIRED) <whissi> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Thomas Deutschmann (RETIRED)
2017-08-15 09:55:15 UTC
same problem here Still in gcc's master:
> snprintf (program_name, sizeof (program_name), program_invocation_name);
I think the intent was to add "%s" here. Or a call to strncpy().
On top of that gettext helpers trigger it today as well: """ x86_64-pc-linux-gnu-g++ -I/tmp/portage/sys-devel/gcc-9.2.0-r3/work/gcc-9.2.0/libcpp -I. -I/tmp/portage/sys-devel/gcc-9.2.0-r3/work/gcc-9.2.0/libcpp/../include -I/tmp/portage/sys-devel/gcc-9.2.0-r3/work/gcc-9.2.0/libcpp/include -O2 -Werror=format-security -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long -fno-exceptions -fno-rtti -I/tmp/portage/sys-devel/gcc-9.2.0-r3/work/gcc-9.2.0/libcpp -I. -I/tmp/portage/sys-devel/gcc-9.2.0-r3/work/gcc-9.2.0/libcpp/../include -I/tmp/portage/sys-devel/gcc-9.2.0-r3/work/gcc-9.2.0/libcpp/include -c -o expr.o -MT expr.o -MMD -MP -MF .deps/expr.Tpo /tmp/portage/sys-devel/gcc-9.2.0-r3/work/gcc-9.2.0/libcpp/expr.c /tmp/portage/sys-devel/gcc-9.2.0-r3/work/gcc-9.2.0/libcpp/expr.c: In function 'unsigned int cpp_classify_number(cpp_reader*, const cpp_token*, const char**, location_t)': /tmp/portage/sys-devel/gcc-9.2.0-r3/work/gcc-9.2.0/libcpp/expr.c:797:18: error: format not a string literal and no format arguments [-Werror=format-security] 797 | 0, message); | ^ /tmp/portage/sys-devel/gcc-9.2.0-r3/work/gcc-9.2.0/libcpp/expr.c:800:39: error: format not a string literal and no format arguments [-Werror=format-security] 800 | virtual_location, 0, message); | ^ """ I suggest reporting them upstream and fix there. |