Re: Building 4.14 LTS kernel with GCC 8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 11, 2018 at 8:29 AM Greg KH <greg@xxxxxxxxx> wrote:

> Why is this last commit needed?

Without it I get the following compile error (Debian 9 with
self-compiled GCC 8):

builtin-script.c: In function 'get_script_path':
builtin-script.c:2139:20: error: '%s' directive writing up to 255
bytes into a region of size between 0 and 4095
[-Werror=format-overflow=]
  sprintf(path, "%s/%s", base_path, dent->d_name);
                    ^~
In file included from /usr/include/stdio.h:938,
                 from util/event.h:6,
                 from util/debug.h:9,
                 from builtin-script.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note:
'__builtin___sprintf_chk' output between 2 and 4352 bytes into a
destination of size 4096
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
builtin-script.c:2139:20: error: '%s' directive writing up to 255
bytes into a region of size between 0 and 4095
[-Werror=format-overflow=]
  sprintf(path, "%s/%s", base_path, dent->d_name);
                    ^~
In file included from /usr/include/stdio.h:938,
                 from util/event.h:6,
                 from util/debug.h:9,
                 from builtin-script.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note:
'__builtin___sprintf_chk' output between 2 and 4352 bytes into a
destination of size 4096
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
builtin-script.c: In function 'find_scripts':
builtin-script.c:2139:20: error: '%s' directive writing up to 255
bytes into a region of size between 0 and 4095
[-Werror=format-overflow=]
  sprintf(path, "%s/%s", base_path, dent->d_name);
                    ^~
In file included from /usr/include/stdio.h:938,
                 from util/event.h:6,
                 from util/debug.h:9,
                 from builtin-script.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note:
'__builtin___sprintf_chk' output between 2 and 4352 bytes into a
destination of size 4096
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
builtin-script.c:2139:20: error: '%s' directive writing up to 255
bytes into a region of size between 0 and 4095
[-Werror=format-overflow=]
  sprintf(path, "%s/%s", base_path, dent->d_name);
                    ^~
In file included from /usr/include/stdio.h:938,
                 from util/event.h:6,
                 from util/debug.h:9,
                 from builtin-script.c:6:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note:
'__builtin___sprintf_chk' output between 2 and 4352 bytes into a
destination of size 4096
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Regards,
Ignat



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux