Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 714186

Summary: net-libs/libnipper-0.12.6-r1 : /.../report-table.cpp: error: format not a string literal and no format arguments [-Werror=format-s
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Mike Auty (RETIRED) <ikelos>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 713576    
Attachments: emerge-info.txt
emerge-history.txt
environment
etc.portage.tbz2
logs.tbz2
net-libs:libnipper-0.12.6-r1:20200324-082202.log
temp.tbz2
libnipper-format-security.patch

Description Toralf Förster gentoo-dev 2020-03-24 15:53:36 UTC
[  7%] Building CXX object CMakeFiles/nipper.dir/report/report-table.o
/usr/bin/x86_64-pc-linux-gnu-g++ -Dnipper_EXPORTS   -DNDEBUG -O2 -pipe -march=native  -falign-functions=32:25:16 -fno-common -Werror=format-security -Wformat -fPIC   -O2 -o CMakeFiles/nipper.dir/report/report-table.o -c /var/tmp/portage/net-libs/libnipper-0.12.6-r1/work/libnipper-0.12.6/report/report-table.cpp
/var/tmp/portage/net-libs/libnipper-0.12.6-r1/work/libnipper-0.12.6/report/report-table.cpp: In member function int Report::writeTable(Device::paragraphStruct*):
/var/tmp/portage/net-libs/libnipper-0.12.6-r1/work/libnipper-0.12.6/report/report-table.cpp:362:45: error: format not a string literal and no format arguments [-Werror=format-security]

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_systemd-libressl-20200322-195413

  -------------------------------------------------------------------

  Please see the tracker bug for details.

gcc-config -l:
 [1] x86_64-pc-linux-gnu-9.3.0 *
clang version 10.0.0 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/10/bin
/usr/lib/llvm/10
10.0.0
Available Python interpreters, in order of preference:
  [1]   python3.8
  [2]   python3.7
  [3]   python3.6
  [4]   python2.7 (fallback)
Available Ruby profiles:
  [1]   ruby24 (with Rubygems)
  [2]   ruby25 (with Rubygems) *
The Glorious Glasgow Haskell Compilation System, version 8.0.2

timestamp of HEAD at this tinderbox image:
/var/db/repos/gentoo	Tue 24 Mar 2020 07:41:45 AM UTC
/var/db/repos/libressl	Thu 19 Mar 2020 04:37:24 PM UTC

emerge -qpvO net-libs/libnipper
[ebuild  N    ] net-libs/libnipper-0.12.6-r1
Comment 1 Toralf Förster gentoo-dev 2020-03-24 15:53:39 UTC
Created attachment 625012 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2020-03-24 15:53:42 UTC
Created attachment 625014 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2020-03-24 15:53:44 UTC
Created attachment 625016 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2020-03-24 15:53:47 UTC
Created attachment 625018 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2020-03-24 15:53:50 UTC
Created attachment 625020 [details]
logs.tbz2
Comment 6 Toralf Förster gentoo-dev 2020-03-24 15:53:53 UTC
Created attachment 625022 [details]
net-libs:libnipper-0.12.6-r1:20200324-082202.log
Comment 7 Toralf Förster gentoo-dev 2020-03-24 15:53:55 UTC
Created attachment 625024 [details]
temp.tbz2
Comment 8 Mike Auty (RETIRED) gentoo-dev 2020-03-26 02:12:39 UTC
Created attachment 625882 [details, diff]
libnipper-format-security.patch

I couldn't recreate this when adding CFLAGS="-O2 -pipe -march=native  -falign-functions=32:25:16 -fno-common -Werror=format-security -Wformat", so I don't know if my toolchain would need compiling differently, but I think I've understood the error anyway.  Essentially there's a variable that could be changed which doesn't contain a format argument.  Since in the code the value doesn't ever actually change, I've made the entire thing a fixed const, which hopefully then will be accepted by the compiler.

Is there any way to easily test this patch in your build system, or let me know what changes I'd need to make to my system to be able to reproduce the error?