https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98444

            Bug ID: 98444
           Summary: [10 Regression] compile error with -ftracer and
                    -Werror=format-overflow
           Product: gcc
           Version: 10.2.1
               URL: https://github.com/elogind/elogind/issues/189
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: drfiemost at email dot it
  Target Milestone: ---

Created attachment 49843
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49843&action=edit
Preprocessed source

I get the following error compiling the attached code with gcc-10 (gcc version
10.2.1 20201205):

$ gcc -O2 -ftracer -Werror=format-overflow -c pam_elogind.i 
../src/login/pam_elogind.c: In function ‘export_legacy_dbus_address’:
../src/login/pam_elogind.c:315:13: error: ‘%s’ directive argument is null
[-Werror=format-overflow=]
cc1: some warnings being treated as errors


According to upstream [1] the variable is asserted before calling the function
so it will never be null.
The code compiles fine with gcc-9 and even with gcc-10 when removing the
-ftracer flag.
I can't tell if it's a regression in gcc-10, just a false positive or what so
I'm reporting it here.

[1] https://github.com/elogind/elogind/issues/189

Reply via email to