public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	llvm@lists.linux.dev, linux-kernel@vger.kernel.org,
	patches@lists.linux.dev
Subject: Re: [PATCH 3/5] Compiler Attributes: add more Clang documentation links
Date: Sun, 4 Aug 2024 11:01:06 -0700	[thread overview]
Message-ID: <20240804180106.GC2627063@thelio-3990X> (raw)
In-Reply-To: <20240803171933.483316-3-ojeda@kernel.org>

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
> 

  reply	other threads:[~2024-08-04 18:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240804180106.GC2627063@thelio-3990X \
    --to=nathan@kernel.org \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=ndesaulniers@google.com \
    --cc=ojeda@kernel.org \
    --cc=patches@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox