public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs
@ 2024-08-03 17:19 Miguel Ojeda
  2024-08-03 17:19 ` [PATCH 2/5] Compiler Attributes: remove unneeded version comments for older LLVMs Miguel Ojeda
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Miguel Ojeda @ 2024-08-03 17:19 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
	llvm, linux-kernel, patches

Clang 18 was released with support for `counted_by`, thus point to the
documentation now instead of the implementation PR.

Similarly, GCC's bugzilla issue is now closed and GCC has a documentation
page for it.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler_attributes.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
index 32284cd26d52..b658136e6cda 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -98,8 +98,8 @@
  * Optional: only supported since gcc >= 15
  * Optional: only supported since clang >= 18
  *
- *   gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896
- * clang: https://github.com/llvm/llvm-project/pull/76348
+ *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-counted_005fby-variable-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#counted-by
  */
 #if __has_attribute(__counted_by__)
 # define __counted_by(member)		__attribute__((__counted_by__(member)))

base-commit: 8400291e289ee6b2bf9779ff1c83a291501f017b
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/5] Compiler Attributes: remove unneeded version comments for older LLVMs
  2024-08-03 17:19 [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs Miguel Ojeda
@ 2024-08-03 17:19 ` Miguel Ojeda
  2024-08-04 17:55   ` Nathan Chancellor
  2024-08-03 17:19 ` [PATCH 3/5] Compiler Attributes: add more Clang documentation links Miguel Ojeda
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Miguel Ojeda @ 2024-08-03 17:19 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
	llvm, linux-kernel, patches

The kernel upgraded to support only LLVM >= 13 in commit 9c1b86f8ce04
("kbuild: raise the minimum supported version of LLVM to 13.0.1"),
thus remove version comments that are not needed anymore.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler_attributes.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
index b658136e6cda..5d171a7f8cbd 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -256,7 +256,7 @@
 #endif
 
 /*
- * Optional: only supported since GCC >= 7.1, clang >= 13.0.
+ * Optional: only supported since GCC >= 7.1
  *
  *      gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fprofile_005finstrument_005ffunction-function-attribute
  *    clang: https://clang.llvm.org/docs/AttributeReference.html#no-profile-instrument-function
@@ -275,7 +275,7 @@
 #define __noreturn                      __attribute__((__noreturn__))
 
 /*
- * Optional: only supported since GCC >= 11.1, clang >= 7.0.
+ * Optional: only supported since GCC >= 11.1
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fstack_005fprotector-function-attribute
  *   clang: https://clang.llvm.org/docs/AttributeReference.html#no-stack-protector-safebuffers
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/5] Compiler Attributes: add more Clang documentation links
  2024-08-03 17:19 [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs Miguel Ojeda
  2024-08-03 17:19 ` [PATCH 2/5] Compiler Attributes: remove unneeded version comments for older LLVMs Miguel Ojeda
@ 2024-08-03 17:19 ` Miguel Ojeda
  2024-08-04 18:01   ` Nathan Chancellor
  2024-08-03 17:19 ` [PATCH 4/5] Compiler Attributes: fix formatting of GCC/Clang doc links Miguel Ojeda
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Miguel Ojeda @ 2024-08-03 17:19 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
	llvm, linux-kernel, patches

Some more documentation has been written in Clang for some of the
attributes, thus link them.

In some cases, they only have a "No documentation." entry, but at least
they are acknowledged (and documentation may be eventually written).

In one case, the link has been updated instead, since the URI fragment
changed.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler_attributes.h | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
index 5d171a7f8cbd..2d1ad2a74a4e 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -22,6 +22,7 @@
 
 /*
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alias-function-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#alias
  */
 #define __alias(symbol)                 __attribute__((__alias__(#symbol)))
 
@@ -29,6 +30,7 @@
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-aligned-function-attribute
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-aligned-type-attribute
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-aligned-variable-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#alignas-align-alignas-aligned
  */
 #define __aligned(x)                    __attribute__((__aligned__(x)))
 #define __aligned_largest               __attribute__((__aligned__))
@@ -50,7 +52,7 @@
  * inlinable [-Wattributes]" is emitted).
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-always_005finline-function-attribute
- * clang: mentioned
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#always-inline-force-inline
  */
 #define __always_inline                 inline __attribute__((__always_inline__))
 
@@ -79,6 +81,7 @@
  * Note the long name.
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#const
  */
 #define __attribute_const__             __attribute__((__const__))
 
@@ -146,6 +149,7 @@
  * Optional: only supported since clang >= 14.0
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-error-function-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#error-warning
  */
 #if __has_attribute(__error__)
 # define __compiletime_error(msg)       __attribute__((__error__(msg)))
@@ -186,6 +190,7 @@
 /*
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-mode-type-attribute
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-mode-variable-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#mode
  */
 #define __mode(x)                       __attribute__((__mode__(x)))
 
@@ -222,6 +227,7 @@
  *   return [expression];
  *
  *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#fallthrough
  */
 #if __has_attribute(__fallthrough__)
 # define fallthrough                    __attribute__((__fallthrough__))
@@ -239,7 +245,7 @@
  * Note the missing underscores.
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noinline-function-attribute
- * clang: mentioned
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#noinline
  */
 #define   noinline                      __attribute__((__noinline__))
 
@@ -269,8 +275,7 @@
 
 /*
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noreturn-function-attribute
- * clang: https://clang.llvm.org/docs/AttributeReference.html#noreturn
- * clang: https://clang.llvm.org/docs/AttributeReference.html#id1
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#noreturn-noreturn
  */
 #define __noreturn                      __attribute__((__noreturn__))
 
@@ -323,6 +328,7 @@
 
 /*
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#pure
  */
 #define __pure                          __attribute__((__pure__))
 
@@ -358,6 +364,7 @@
 /*
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-used-function-attribute
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-used-variable-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#used
  */
 #define __used                          __attribute__((__used__))
 
@@ -384,6 +391,7 @@
  * Optional: only supported since clang >= 14.0
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-warning-function-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#error-warning
  */
 #if __has_attribute(__warning__)
 # define __compiletime_warning(msg)     __attribute__((__warning__(msg)))
@@ -412,6 +420,7 @@
 /*
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-weak-function-attribute
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-weak-variable-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#weak
  */
 #define __weak                          __attribute__((__weak__))
 
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/5] Compiler Attributes: fix formatting of GCC/Clang doc links
  2024-08-03 17:19 [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs Miguel Ojeda
  2024-08-03 17:19 ` [PATCH 2/5] Compiler Attributes: remove unneeded version comments for older LLVMs Miguel Ojeda
  2024-08-03 17:19 ` [PATCH 3/5] Compiler Attributes: add more Clang documentation links Miguel Ojeda
@ 2024-08-03 17:19 ` Miguel Ojeda
  2024-08-04 18:03   ` Nathan Chancellor
  2024-08-03 17:19 ` [PATCH 5/5] Compiler Attributes: make version constraints more consistent Miguel Ojeda
  2024-08-04 17:54 ` [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs Nathan Chancellor
  4 siblings, 1 reply; 10+ messages in thread
From: Miguel Ojeda @ 2024-08-03 17:19 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
	llvm, linux-kernel, patches

Over time, some links have been added that did not follow the formatting
of the rest. Fix it for consistency.

No non-whitespace changes intended.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler_attributes.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
index 2d1ad2a74a4e..a6e8c9406f7a 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -226,7 +226,7 @@
  *   goto <label>;
  *   return [expression];
  *
- *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
+ *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
  * clang: https://clang.llvm.org/docs/AttributeReference.html#fallthrough
  */
 #if __has_attribute(__fallthrough__)
@@ -236,7 +236,7 @@
 #endif
 
 /*
- * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
+ *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
  * clang: https://clang.llvm.org/docs/AttributeReference.html#flatten
  */
 # define __flatten			__attribute__((flatten))
@@ -264,8 +264,8 @@
 /*
  * Optional: only supported since GCC >= 7.1
  *
- *      gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fprofile_005finstrument_005ffunction-function-attribute
- *    clang: https://clang.llvm.org/docs/AttributeReference.html#no-profile-instrument-function
+ *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fprofile_005finstrument_005ffunction-function-attribute
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#no-profile-instrument-function
  */
 #if __has_attribute(__no_profile_instrument_function__)
 # define __no_profile                  __attribute__((__no_profile_instrument_function__))
@@ -283,7 +283,7 @@
  * Optional: only supported since GCC >= 11.1
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fstack_005fprotector-function-attribute
- *   clang: https://clang.llvm.org/docs/AttributeReference.html#no-stack-protector-safebuffers
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#no-stack-protector-safebuffers
  */
 #if __has_attribute(__no_stack_protector__)
 # define __no_stack_protector		__attribute__((__no_stack_protector__))
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/5] Compiler Attributes: make version constraints more consistent
  2024-08-03 17:19 [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs Miguel Ojeda
                   ` (2 preceding siblings ...)
  2024-08-03 17:19 ` [PATCH 4/5] Compiler Attributes: fix formatting of GCC/Clang doc links Miguel Ojeda
@ 2024-08-03 17:19 ` Miguel Ojeda
  2024-08-04 18:04   ` Nathan Chancellor
  2024-08-04 17:54 ` [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs Nathan Chancellor
  4 siblings, 1 reply; 10+ messages in thread
From: Miguel Ojeda @ 2024-08-03 17:19 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
	llvm, linux-kernel, patches

Over time, some version constraints have been added that did not follow
the formatting of the rest. Fix it for consistency.

Some of the version requirements can be simplified, too.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
 include/linux/compiler_attributes.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
index a6e8c9406f7a..908e59e261c0 100644
--- a/include/linux/compiler_attributes.h
+++ b/include/linux/compiler_attributes.h
@@ -112,7 +112,7 @@
 
 /*
  * Optional: not supported by gcc
- * Optional: only supported since clang >= 14.0
+ * Optional: only supported since clang >= 14
  *
  * clang: https://clang.llvm.org/docs/AttributeReference.html#diagnose_as_builtin
  */
@@ -146,7 +146,7 @@
 #endif
 
 /*
- * Optional: only supported since clang >= 14.0
+ * Optional: only supported since clang >= 14
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-error-function-attribute
  * clang: https://clang.llvm.org/docs/AttributeReference.html#error-warning
@@ -262,7 +262,7 @@
 #endif
 
 /*
- * Optional: only supported since GCC >= 7.1
+ * Optional: only supported since gcc >= 7
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fprofile_005finstrument_005ffunction-function-attribute
  * clang: https://clang.llvm.org/docs/AttributeReference.html#no-profile-instrument-function
@@ -280,7 +280,7 @@
 #define __noreturn                      __attribute__((__noreturn__))
 
 /*
- * Optional: only supported since GCC >= 11.1
+ * Optional: only supported since gcc >= 11
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fstack_005fprotector-function-attribute
  * clang: https://clang.llvm.org/docs/AttributeReference.html#no-stack-protector-safebuffers
@@ -388,7 +388,7 @@
 #define __must_check                    __attribute__((__warn_unused_result__))
 
 /*
- * Optional: only supported since clang >= 14.0
+ * Optional: only supported since clang >= 14
  *
  *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-warning-function-attribute
  * clang: https://clang.llvm.org/docs/AttributeReference.html#error-warning
@@ -400,7 +400,7 @@
 #endif
 
 /*
- * Optional: only supported since clang >= 14.0
+ * Optional: only supported since clang >= 14
  *
  * clang: https://clang.llvm.org/docs/AttributeReference.html#disable-sanitizer-instrumentation
  *
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs
  2024-08-03 17:19 [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs Miguel Ojeda
                   ` (3 preceding siblings ...)
  2024-08-03 17:19 ` [PATCH 5/5] Compiler Attributes: make version constraints more consistent Miguel Ojeda
@ 2024-08-04 17:54 ` Nathan Chancellor
  4 siblings, 0 replies; 10+ messages in thread
From: Nathan Chancellor @ 2024-08-04 17:54 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Nick Desaulniers, Bill Wendling, Justin Stitt, llvm, linux-kernel,
	patches

On Sat, Aug 03, 2024 at 07:19:29PM +0200, Miguel Ojeda wrote:
> Clang 18 was released with support for `counted_by`, thus point to the
> documentation now instead of the implementation PR.
> 
> Similarly, GCC's bugzilla issue is now closed and GCC has a documentation
> page for it.
> 
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  include/linux/compiler_attributes.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
> index 32284cd26d52..b658136e6cda 100644
> --- a/include/linux/compiler_attributes.h
> +++ b/include/linux/compiler_attributes.h
> @@ -98,8 +98,8 @@
>   * Optional: only supported since gcc >= 15
>   * Optional: only supported since clang >= 18
>   *
> - *   gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896
> - * clang: https://github.com/llvm/llvm-project/pull/76348
> + *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-counted_005fby-variable-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#counted-by
>   */
>  #if __has_attribute(__counted_by__)
>  # define __counted_by(member)		__attribute__((__counted_by__(member)))
> 
> base-commit: 8400291e289ee6b2bf9779ff1c83a291501f017b
> -- 
> 2.46.0
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/5] Compiler Attributes: remove unneeded version comments for older LLVMs
  2024-08-03 17:19 ` [PATCH 2/5] Compiler Attributes: remove unneeded version comments for older LLVMs Miguel Ojeda
@ 2024-08-04 17:55   ` Nathan Chancellor
  0 siblings, 0 replies; 10+ messages in thread
From: Nathan Chancellor @ 2024-08-04 17:55 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Nick Desaulniers, Bill Wendling, Justin Stitt, llvm, linux-kernel,
	patches

On Sat, Aug 03, 2024 at 07:19:30PM +0200, Miguel Ojeda wrote:
> The kernel upgraded to support only LLVM >= 13 in commit 9c1b86f8ce04
> ("kbuild: raise the minimum supported version of LLVM to 13.0.1"),
> thus remove version comments that are not needed anymore.
> 
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Whoops :)

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  include/linux/compiler_attributes.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
> index b658136e6cda..5d171a7f8cbd 100644
> --- a/include/linux/compiler_attributes.h
> +++ b/include/linux/compiler_attributes.h
> @@ -256,7 +256,7 @@
>  #endif
>  
>  /*
> - * Optional: only supported since GCC >= 7.1, clang >= 13.0.
> + * Optional: only supported since GCC >= 7.1
>   *
>   *      gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fprofile_005finstrument_005ffunction-function-attribute
>   *    clang: https://clang.llvm.org/docs/AttributeReference.html#no-profile-instrument-function
> @@ -275,7 +275,7 @@
>  #define __noreturn                      __attribute__((__noreturn__))
>  
>  /*
> - * Optional: only supported since GCC >= 11.1, clang >= 7.0.
> + * Optional: only supported since GCC >= 11.1
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fstack_005fprotector-function-attribute
>   *   clang: https://clang.llvm.org/docs/AttributeReference.html#no-stack-protector-safebuffers
> -- 
> 2.46.0
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/5] Compiler Attributes: add more Clang documentation links
  2024-08-03 17:19 ` [PATCH 3/5] Compiler Attributes: add more Clang documentation links Miguel Ojeda
@ 2024-08-04 18:01   ` Nathan Chancellor
  0 siblings, 0 replies; 10+ messages in thread
From: Nathan Chancellor @ 2024-08-04 18:01 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Nick Desaulniers, Bill Wendling, Justin Stitt, llvm, linux-kernel,
	patches

On Sat, Aug 03, 2024 at 07:19:31PM +0200, Miguel Ojeda wrote:
> Some more documentation has been written in Clang for some of the
> attributes, thus link them.
> 
> In some cases, they only have a "No documentation." entry, but at least
> they are acknowledged (and documentation may be eventually written).

For what it's worth, I recall a message on Discourse about trying to
correct this, even if the solution is just to say "it's the same as
GCC":

https://discourse.llvm.org/t/documenting-our-attributes/70019

But I am not sure that really went anywhere :/

> In one case, the link has been updated instead, since the URI fragment
> changed.
> 
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  include/linux/compiler_attributes.h | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
> index 5d171a7f8cbd..2d1ad2a74a4e 100644
> --- a/include/linux/compiler_attributes.h
> +++ b/include/linux/compiler_attributes.h
> @@ -22,6 +22,7 @@
>  
>  /*
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alias-function-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#alias
>   */
>  #define __alias(symbol)                 __attribute__((__alias__(#symbol)))
>  
> @@ -29,6 +30,7 @@
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-aligned-function-attribute
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-aligned-type-attribute
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-aligned-variable-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#alignas-align-alignas-aligned
>   */
>  #define __aligned(x)                    __attribute__((__aligned__(x)))
>  #define __aligned_largest               __attribute__((__aligned__))
> @@ -50,7 +52,7 @@
>   * inlinable [-Wattributes]" is emitted).
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-always_005finline-function-attribute
> - * clang: mentioned
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#always-inline-force-inline
>   */
>  #define __always_inline                 inline __attribute__((__always_inline__))
>  
> @@ -79,6 +81,7 @@
>   * Note the long name.
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#const
>   */
>  #define __attribute_const__             __attribute__((__const__))
>  
> @@ -146,6 +149,7 @@
>   * Optional: only supported since clang >= 14.0
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-error-function-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#error-warning
>   */
>  #if __has_attribute(__error__)
>  # define __compiletime_error(msg)       __attribute__((__error__(msg)))
> @@ -186,6 +190,7 @@
>  /*
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#index-mode-type-attribute
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-mode-variable-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#mode
>   */
>  #define __mode(x)                       __attribute__((__mode__(x)))
>  
> @@ -222,6 +227,7 @@
>   *   return [expression];
>   *
>   *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#fallthrough
>   */
>  #if __has_attribute(__fallthrough__)
>  # define fallthrough                    __attribute__((__fallthrough__))
> @@ -239,7 +245,7 @@
>   * Note the missing underscores.
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noinline-function-attribute
> - * clang: mentioned
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#noinline
>   */
>  #define   noinline                      __attribute__((__noinline__))
>  
> @@ -269,8 +275,7 @@
>  
>  /*
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noreturn-function-attribute
> - * clang: https://clang.llvm.org/docs/AttributeReference.html#noreturn
> - * clang: https://clang.llvm.org/docs/AttributeReference.html#id1
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#noreturn-noreturn
>   */
>  #define __noreturn                      __attribute__((__noreturn__))
>  
> @@ -323,6 +328,7 @@
>  
>  /*
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#pure
>   */
>  #define __pure                          __attribute__((__pure__))
>  
> @@ -358,6 +364,7 @@
>  /*
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-used-function-attribute
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-used-variable-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#used
>   */
>  #define __used                          __attribute__((__used__))
>  
> @@ -384,6 +391,7 @@
>   * Optional: only supported since clang >= 14.0
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-warning-function-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#error-warning
>   */
>  #if __has_attribute(__warning__)
>  # define __compiletime_warning(msg)     __attribute__((__warning__(msg)))
> @@ -412,6 +420,7 @@
>  /*
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-weak-function-attribute
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-weak-variable-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#weak
>   */
>  #define __weak                          __attribute__((__weak__))
>  
> -- 
> 2.46.0
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/5] Compiler Attributes: fix formatting of GCC/Clang doc links
  2024-08-03 17:19 ` [PATCH 4/5] Compiler Attributes: fix formatting of GCC/Clang doc links Miguel Ojeda
@ 2024-08-04 18:03   ` Nathan Chancellor
  0 siblings, 0 replies; 10+ messages in thread
From: Nathan Chancellor @ 2024-08-04 18:03 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Nick Desaulniers, Bill Wendling, Justin Stitt, llvm, linux-kernel,
	patches

On Sat, Aug 03, 2024 at 07:19:32PM +0200, Miguel Ojeda wrote:
> Over time, some links have been added that did not follow the formatting
> of the rest. Fix it for consistency.
> 
> No non-whitespace changes intended.
> 
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

It might be worth calling out the expected format (aligned on the colon)
since I was initially confused until I looked a little harder :)

> ---
>  include/linux/compiler_attributes.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
> index 2d1ad2a74a4e..a6e8c9406f7a 100644
> --- a/include/linux/compiler_attributes.h
> +++ b/include/linux/compiler_attributes.h
> @@ -226,7 +226,7 @@
>   *   goto <label>;
>   *   return [expression];
>   *
> - *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
> + *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
>   * clang: https://clang.llvm.org/docs/AttributeReference.html#fallthrough
>   */
>  #if __has_attribute(__fallthrough__)
> @@ -236,7 +236,7 @@
>  #endif
>  
>  /*
> - * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
> + *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
>   * clang: https://clang.llvm.org/docs/AttributeReference.html#flatten
>   */
>  # define __flatten			__attribute__((flatten))
> @@ -264,8 +264,8 @@
>  /*
>   * Optional: only supported since GCC >= 7.1
>   *
> - *      gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fprofile_005finstrument_005ffunction-function-attribute
> - *    clang: https://clang.llvm.org/docs/AttributeReference.html#no-profile-instrument-function
> + *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fprofile_005finstrument_005ffunction-function-attribute
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#no-profile-instrument-function
>   */
>  #if __has_attribute(__no_profile_instrument_function__)
>  # define __no_profile                  __attribute__((__no_profile_instrument_function__))
> @@ -283,7 +283,7 @@
>   * Optional: only supported since GCC >= 11.1
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fstack_005fprotector-function-attribute
> - *   clang: https://clang.llvm.org/docs/AttributeReference.html#no-stack-protector-safebuffers
> + * clang: https://clang.llvm.org/docs/AttributeReference.html#no-stack-protector-safebuffers
>   */
>  #if __has_attribute(__no_stack_protector__)
>  # define __no_stack_protector		__attribute__((__no_stack_protector__))
> -- 
> 2.46.0
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 5/5] Compiler Attributes: make version constraints more consistent
  2024-08-03 17:19 ` [PATCH 5/5] Compiler Attributes: make version constraints more consistent Miguel Ojeda
@ 2024-08-04 18:04   ` Nathan Chancellor
  0 siblings, 0 replies; 10+ messages in thread
From: Nathan Chancellor @ 2024-08-04 18:04 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Nick Desaulniers, Bill Wendling, Justin Stitt, llvm, linux-kernel,
	patches

On Sat, Aug 03, 2024 at 07:19:33PM +0200, Miguel Ojeda wrote:
> Over time, some version constraints have been added that did not follow
> the formatting of the rest. Fix it for consistency.
> 
> Some of the version requirements can be simplified, too.
> 
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

Yeah, I think just having the major version is reasonable, especially
since Clang has moved to GCC's version scheme of x.0 for main, x.1 for
release.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  include/linux/compiler_attributes.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h
> index a6e8c9406f7a..908e59e261c0 100644
> --- a/include/linux/compiler_attributes.h
> +++ b/include/linux/compiler_attributes.h
> @@ -112,7 +112,7 @@
>  
>  /*
>   * Optional: not supported by gcc
> - * Optional: only supported since clang >= 14.0
> + * Optional: only supported since clang >= 14
>   *
>   * clang: https://clang.llvm.org/docs/AttributeReference.html#diagnose_as_builtin
>   */
> @@ -146,7 +146,7 @@
>  #endif
>  
>  /*
> - * Optional: only supported since clang >= 14.0
> + * Optional: only supported since clang >= 14
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-error-function-attribute
>   * clang: https://clang.llvm.org/docs/AttributeReference.html#error-warning
> @@ -262,7 +262,7 @@
>  #endif
>  
>  /*
> - * Optional: only supported since GCC >= 7.1
> + * Optional: only supported since gcc >= 7
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fprofile_005finstrument_005ffunction-function-attribute
>   * clang: https://clang.llvm.org/docs/AttributeReference.html#no-profile-instrument-function
> @@ -280,7 +280,7 @@
>  #define __noreturn                      __attribute__((__noreturn__))
>  
>  /*
> - * Optional: only supported since GCC >= 11.1
> + * Optional: only supported since gcc >= 11
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fstack_005fprotector-function-attribute
>   * clang: https://clang.llvm.org/docs/AttributeReference.html#no-stack-protector-safebuffers
> @@ -388,7 +388,7 @@
>  #define __must_check                    __attribute__((__warn_unused_result__))
>  
>  /*
> - * Optional: only supported since clang >= 14.0
> + * Optional: only supported since clang >= 14
>   *
>   *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-warning-function-attribute
>   * clang: https://clang.llvm.org/docs/AttributeReference.html#error-warning
> @@ -400,7 +400,7 @@
>  #endif
>  
>  /*
> - * Optional: only supported since clang >= 14.0
> + * Optional: only supported since clang >= 14
>   *
>   * clang: https://clang.llvm.org/docs/AttributeReference.html#disable-sanitizer-instrumentation
>   *
> -- 
> 2.46.0
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-08-04 18:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-03 17:19 [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs Miguel Ojeda
2024-08-03 17:19 ` [PATCH 2/5] Compiler Attributes: remove unneeded version comments for older LLVMs Miguel Ojeda
2024-08-04 17:55   ` Nathan Chancellor
2024-08-03 17:19 ` [PATCH 3/5] Compiler Attributes: add more Clang documentation links Miguel Ojeda
2024-08-04 18:01   ` Nathan Chancellor
2024-08-03 17:19 ` [PATCH 4/5] Compiler Attributes: fix formatting of GCC/Clang doc links Miguel Ojeda
2024-08-04 18:03   ` Nathan Chancellor
2024-08-03 17:19 ` [PATCH 5/5] Compiler Attributes: make version constraints more consistent Miguel Ojeda
2024-08-04 18:04   ` Nathan Chancellor
2024-08-04 17:54 ` [PATCH 1/5] Compiler Attributes: update GCC and Clang's `counted_by` URLs Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox