Go to file
Linus Torvalds adc7192096 gcc-10: disable 'restrict' warning for now
gcc-10 now warns about passing aliasing pointers to functions that take
restricted pointers.

That's actually a great warning, and if we ever start using 'restrict'
in the kernel, it might be quite useful.  But right now we don't, and it
turns out that the only thing this warns about is an idiom where we have
declared a few functions to be "printf-like" (which seems to make gcc
pick up the restricted pointer thing), and then we print to the same
buffer that we also use as an input.

And people do that as an odd concatenation pattern, with code like this:

    #define sysfs_show_gen_prop(buffer, fmt, ...) \
        snprintf(buffer, PAGE_SIZE, "%s"fmt, buffer, __VA_ARGS__)

where we have 'buffer' as both the destination of the final result, and
as the initial argument.

Yes, it's a bit questionable.  And outside of the kernel, people do have
standard declarations like

    int snprintf( char *restrict buffer, size_t bufsz,
                  const char *restrict format, ... );

where that output buffer is marked as a restrict pointer that cannot
alias with any other arguments.

But in the context of the kernel, that 'use snprintf() to concatenate to
the end result' does work, and the pattern shows up in multiple places.
And we have not marked our own version of snprintf() as taking restrict
pointers, so the warning is incorrect for now, and gcc picks it up on
its own.

If we do start using 'restrict' in the kernel (and it might be a good
idea if people find places where it matters), we'll need to figure out
how to avoid this issue for snprintf and friends.  But in the meantime,
this warning is not useful.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-05-09 15:45:21 -07:00
arch Merge branch 'akpm' (patches from Andrew) 2020-05-08 08:41:09 -07:00
block
certs
crypto
Documentation
drivers SCSI fixes on 20200508 2020-05-08 10:36:56 -07:00
fs io_uring-5.7-2020-05-08 2020-05-09 12:02:09 -07:00
include Char/Misc driver fixes for 5.7-rc5 2020-05-08 09:11:53 -07:00
init Stop the ad-hoc games with -Wno-maybe-initialized 2020-05-09 13:57:10 -07:00
ipc
kernel Stop the ad-hoc games with -Wno-maybe-initialized 2020-05-09 13:57:10 -07:00
lib ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST 2020-05-07 19:27:21 -07:00
LICENSES
mm mm: limit boost_watermark on small zones 2020-05-07 19:27:21 -07:00
net
samples
scripts scripts/gdb: repair rb_first() and rb_last() 2020-05-07 19:27:20 -07:00
security
sound
tools Merge branch 'akpm' (patches from Andrew) 2020-05-08 08:41:09 -07:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS Fixes for an endianness handling bug that prevented mounts on 2020-05-08 10:27:00 -07:00
Makefile gcc-10: disable 'restrict' warning for now 2020-05-09 15:45:21 -07:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.