]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge tag 'auto-type-conversion-for-v6.19-rc1' of git://git.kernel.org/pub/scm/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Dec 2025 20:41:10 +0000 (05:41 +0900)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Dec 2025 20:41:10 +0000 (05:41 +0900)
Pull __auto_type to auto conversion from Peter Anvin:
 "Convert '__auto_type' to 'auto', defining a macro for 'auto' unless
  C23+ is in use"

* tag 'auto-type-conversion-for-v6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-auto:
  tools/virtio: replace "__auto_type" with "auto"
  selftests/bpf: replace "__auto_type" with "auto"
  arch/x86: replace "__auto_type" with "auto"
  arch/nios2: replace "__auto_type" and adjacent equivalent with "auto"
  fs/proc: replace "__auto_type" with "const auto"
  include/linux: change "__auto_type" to "auto"
  compiler_types.h: add "auto" as a macro for "__auto_type"

1  2 
include/linux/compiler_types.h

index 45875903960ed9bda97108610d5acd1da28bb515,41172a28ce76d6d74339bccb3096ca5bdd6eb916..1280693766b9dd844ec7ca83053381799be12456
  #define __has_builtin(x) (0)
  #endif
  
 +/* Indirect macros required for expanded argument pasting, eg. __LINE__. */
 +#define ___PASTE(a, b) a##b
 +#define __PASTE(a, b) ___PASTE(a, b)
 +
  #ifndef __ASSEMBLY__
  
+ /*
+  * C23 introduces "auto" as a standard way to define type-inferred
+  * variables, but "auto" has been a (useless) keyword even since K&R C,
+  * so it has always been "namespace reserved."
+  *
+  * Until at some future time we require C23 support, we need the gcc
+  * extension __auto_type, but there is no reason to put that elsewhere
+  * in the source code.
+  */
+ #if __STDC_VERSION__ < 202311L
+ # define auto __auto_type
+ #endif
  /*
   * Skipped when running bindgen due to a libclang issue;
   * see https://github.com/rust-lang/rust-bindgen/issues/2244.