This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/83586] New: [8 regression] Invalid -Wformat-truncation on stdio2.h


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

            Bug ID: 83586
           Summary: [8 regression] Invalid -Wformat-truncation on stdio2.h
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sylvestre at debian dot org
                CC: trippels at gcc dot gnu.org
  Target Milestone: ---

/root/firefox-gcc-last/dom/gamepad/linux/LinuxGamepad.cpp: In member function
'void {anonymous}::LinuxGamepadService::AddDevice(mozilla::udev_device*)':
/root/firefox-gcc-last/dom/gamepad/linux/LinuxGamepad.cpp:87:1: error: '%s'
directive output may be truncated writing up to 127 bytes into a region of size
between 112 and 126 [-Werror=format-truncation=]
 LinuxGamepadService::AddDevice(struct udev_device* dev)
 ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:938,
                 from
/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/system_wrappers/stdio.h:3,
                 from
/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/nsTraceRefcnt.h:9,
                 from
/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Assertions.h:23,
                 from
/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/Casting.h:12,
                 from
/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/js/Value.h:13,
                 from
/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/mozilla/ErrorResult.h:31,
                 from /root/firefox-gcc-last/dom/gamepad/Gamepad.h:10,
                 from /root/firefox-gcc-last/dom/gamepad/Gamepad.cpp:7,
                 from
/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dom/gamepad/Unified_cpp_dom_gamepad0.cpp:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:35: note:
'__builtin___snprintf_chk' output 3 or more bytes (assuming 144) into a
destination of size 128
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors


Not sure what is going on but we don't have this issue with gcc 7

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]