-
Notifications
You must be signed in to change notification settings - Fork 146
Replace "__auto_type" with "auto" #9327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bpf-next_base
Are you sure you want to change the base?
Conversation
Upstream branch: beb1097 |
b5a617e
to
ffefc6d
Compare
Upstream branch: 42be23e |
9837e7a
to
384da75
Compare
Upstream branch: 42be23e |
384da75
to
63492dd
Compare
Upstream branch: 42be23e |
63492dd
to
7c3d561
Compare
Upstream branch: 42be23e |
"auto" was defined as a keyword back in the K&R days, but as a storage type specifier. No one ever used it, since it was and is the default storage type for local variables. C++11 recycled the keyword to allow a type to be declared based on the type of an initializer. This was finally adopted into standard C in C23. gcc and clang provide the "__auto_type" alias keyword as an extension for pre-C23, however, there is no reason to pollute the bulk of the source base with this temporary keyword; instead define "auto" as a macro unless the compiler is running in C23+ mode. This macro is added in <linux/compiler_types.h> because that header is included in some of the tools headers, wheres <linux/compiler.h> is not as it has a bunch of very kernel-specific things in it. Signed-off-by: H. Peter Anvin (Intel) <[email protected]> Acked-by: Miguel Ojeda <[email protected]>
Replace instances of "__auto_type" with "auto" in include/linux. Signed-off-by: H. Peter Anvin (Intel) <[email protected]>
Replace use of "__auto_type" in fs/proc/inode.c with "const auto". Suggested-by: Alexey Dobriyan <[email protected]> Signed-off-by: H. Peter Anvin (Intel) <[email protected]> Reviewed-by: Alexey Dobriyan <[email protected]>
Replace uses of "__auto_type" in arch/nios2/include/asm/uaccess.h with "auto", and equivalently convert an adjacent cast to the analogous form. Suggested-by: Linus Torvalds <[email protected]> Signed-off-by: H. Peter Anvin (Intel) <[email protected]>
Replace instances of "__auto_type" with "auto" in: arch/x86/include/asm/bug.h arch/x86/include/asm/string_64.h arch/x86/include/asm/uaccess_64.h Signed-off-by: H. Peter Anvin (Intel) <[email protected]>
Replace instances of "__auto_type" with "auto" in: tools/testing/selftests/bpf/prog_tests/socket_helpers.h This file does not seem to be including <linux/compiler_types.h> directly or indirectly, so copy the definition but guard it with !defined(auto). Signed-off-by: H. Peter Anvin (Intel) <[email protected]>
Replace one instance of "__auto_type" with "auto" in: tools/virtio/linux/compiler.h This file *does* include <linux/compiler_types.h> directly, so there is no need to duplicate the definition. Signed-off-by: H. Peter Anvin (Intel) <[email protected]>
7c3d561
to
445600c
Compare
Pull request for series with
subject: Replace "__auto_type" with "auto"
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=983885