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

Bug 714000

Summary: sys-devel/gcc-9.3.0 : /.../expr.c: error: format not a string literal and no format arguments [-Werror=format-security]
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
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
sys-devel:gcc-9.3.0:20200322-135529.log
temp.tbz2

Description Toralf Förster gentoo-dev 2020-03-22 14:46:05 UTC
/var/tmp/portage/sys-devel/gcc-9.3.0/work/gcc-9.3.0/libcpp/expr.c: In function unsigned int cpp_classify_number(cpp_reader*, const cpp_token*, const char**, location_t):
/var/tmp/portage/sys-devel/gcc-9.3.0/work/gcc-9.3.0/libcpp/expr.c:797:18: error: format not a string literal and no format arguments [-Werror=format-security]
  797 |        0, message);
      |                  ^
/var/tmp/portage/sys-devel/gcc-9.3.0/work/gcc-9.3.0/libcpp/expr.c:800:39: 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_desktop_gnome-20200322-135559

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

gcc-config -l:
 [1] x86_64-pc-linux-gnu-9.2.0 *
Available Python interpreters, in order of preference:
  [1]   python3.7
  [2]   python3.6
  [3]   python2.7 (fallback)

timestamp of HEAD at this tinderbox image:
/var/db/repos/gentoo	Sun 22 Mar 2020 12:18:34 PM UTC

emerge -qpvO sys-devel/gcc
[ebuild  NS   ] sys-devel/gcc-9.3.0 [9.2.0-r2] USE="(cxx) fortran (multilib) nls nptl openmp pch (pie) sanitize ssp vtv (-altivec) -d -debug -doc (-fixed-point) -go -graphite (-hardened) (-jit) (-libssp) -lto -objc -objc++ -objc-gc -pgo -systemtap -test -vanilla"
Comment 1 Toralf Förster gentoo-dev 2020-03-22 14:46:08 UTC
Created attachment 624478 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2020-03-22 14:46:12 UTC
Created attachment 624480 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2020-03-22 14:46:16 UTC
Created attachment 624482 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2020-03-22 14:46:20 UTC
Created attachment 624484 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2020-03-22 14:46:26 UTC
Created attachment 624486 [details]
logs.tbz2
Comment 6 Toralf Förster gentoo-dev 2020-03-22 14:46:32 UTC
Created attachment 624488 [details]
sys-devel:gcc-9.3.0:20200322-135529.log
Comment 7 Toralf Förster gentoo-dev 2020-03-22 14:46:36 UTC
Created attachment 624490 [details]
temp.tbz2
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2020-03-22 15:00:11 UTC
"""
/var/tmp/portage/sys-devel/gcc-9.3.0/work/gcc-9.3.0/libcpp/expr.c: In function ‘unsigned int cpp_classify_number(cpp_reader*, const cpp_token*, const char**, location_t)’:
/var/tmp/portage/sys-devel/gcc-9.3.0/work/gcc-9.3.0/libcpp/expr.c:797:18: error: format not a string literal and no format arguments [-Werror=format-security]
  797 |        0, message);
      |                  ^
/var/tmp/portage/sys-devel/gcc-9.3.0/work/gcc-9.3.0/libcpp/expr.c:800:39: error: format not a string literal and no format arguments [-Werror=format-security]
  800 |           virtual_location, 0, message);
      |                                       ^
"""

`-Werror=format-security` is not very compatible with NLS marking:

"""
      if ((result & CPP_N_WIDTH) == CPP_N_LARGE
          && CPP_OPTION (pfile, cpp_warn_long_long))
        {
          const char *message = CPP_OPTION (pfile, cplusplus)
                                ? N_("use of C++11 long long integer constant")
                                : N_("use of C99 long long integer constant");

          if (CPP_OPTION (pfile, c99))
            cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location,
                                   0, message);
          else
            cpp_pedwarning_with_line (pfile, CPP_W_LONG_LONG,
                                      virtual_location, 0, message);
        }

      result |= CPP_N_INTEGER;
"""