public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, pedro.falcato@gmail.com
Cc: Rebecca Cran <rebecca@bsdio.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Jayaprakash N <n.jayaprakash@intel.com>,
	pawel.karczewski@solidigm.com
Subject: Re: [edk2-devel] [PATCH edk2-libc 1/1] StdLib: Remove the 'register' keyword from public interfaces
Date: Mon, 19 Feb 2024 21:27:22 +0100	[thread overview]
Message-ID: <2f3457fb-0370-af6d-1e85-d8d736fd9930@redhat.com> (raw)
In-Reply-To: <20240216214653.86540-1-pedro.falcato@gmail.com>

On 2/16/24 22:46, Pedro Falcato wrote:
> ISO C interfaces do not have the 'register' keyword, so this is
> technically non-compliant and other consumers of C headers (such as C++)
> will error out when seeing this keyword.
> 
> This should not affect anything, functionality-wise or ABI-wise.
> 
> Cc: Rebecca Cran <rebecca@bsdio.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Jayaprakash N <n.jayaprakash@intel.com>
> Cc: pawel.karczewski@solidigm.com
> Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
> ---
> 
> This should fix your problem. Pawel, can you check?
> 
>  StdLib/Include/stdlib.h       |  8 ++++----
>  StdLib/Include/string.h       |  6 +++---
>  StdLib/LibC/StdLib/Environs.c |  4 ++--
>  StdLib/LibC/String/strsep.c   | 10 +++++-----
>  4 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/StdLib/Include/stdlib.h b/StdLib/Include/stdlib.h
> index d9aaaab39d46..42810c86e65a 100644
> --- a/StdLib/Include/stdlib.h
> +++ b/StdLib/Include/stdlib.h
> @@ -33,8 +33,8 @@
>      void        exit    (int status) __noreturn;
>      void        _Exit   (int status) __noreturn;
>      char       *getenv  (const char *name);
> -    int         setenv  (register const char * name,
> -                         register const char * value, int rewrite);
> +    int         setenv  (const char * name,
> +                         const char * value, int rewrite);
>      int         system  (const char *string);
>  
>      ################  Integer arithmetic functions
> @@ -279,8 +279,8 @@ char   *getenv(const char *name);
>  **/
>  int
>  setenv (
> -  register const char * name,
> -  register const char * value,
> +  const char * name,
> +  const char * value,
>    int rewrite
>    );
>  
> diff --git a/StdLib/Include/string.h b/StdLib/Include/string.h
> index 0c809441e830..6acd274b848d 100644
> --- a/StdLib/Include/string.h
> +++ b/StdLib/Include/string.h
> @@ -71,7 +71,7 @@
>        int       strncasecmp (const char *s1, const char *s2, size_t n);
>        size_t    strlcpy     (char *destination, const char *source, size_t size);
>        size_t    strlcat     (char *destination, const char *source, size_t size);
> -      char     *strsep      (register char **stringp, register const char *delim);
> +      char     *strsep      (char **stringp, const char *delim);
>      @endverbatim
>  
>      Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
> @@ -484,8 +484,8 @@ size_t  strlcat(char *destination, const char *source, size_t size);
>   */
>  char *
>  strsep(
> -  register char **stringp,
> -  register const char *delim
> +  char **stringp,
> +  const char *delim
>    );
>  
>  __END_DECLS
> diff --git a/StdLib/LibC/StdLib/Environs.c b/StdLib/LibC/StdLib/Environs.c
> index e8cfd6d9f400..ad16444ce89c 100644
> --- a/StdLib/LibC/StdLib/Environs.c
> +++ b/StdLib/LibC/StdLib/Environs.c
> @@ -209,8 +209,8 @@ char   *getenv(const char *name)
>  **/
>  int
>  setenv (
> -  register const char * name,
> -  register const char * value,
> +  const char * name,
> +  const char * value,
>    int rewrite
>    )
>  {
> diff --git a/StdLib/LibC/String/strsep.c b/StdLib/LibC/String/strsep.c
> index 234b0cabd689..d250ff781658 100644
> --- a/StdLib/LibC/String/strsep.c
> +++ b/StdLib/LibC/String/strsep.c
> @@ -53,13 +53,13 @@ static char sccsid[] = "@(#)strsep.c  8.1 (Berkeley) 6/4/93";
>   */
>  char *
>  strsep(
> -  register char **stringp,
> -  register const char *delim
> +  char **stringp,
> +  const char *delim
>    )
>  {
> -  register char *s;
> -  register const char *spanp;
> -  register int c, sc;
> +  char *s;
> +  const char *spanp;
> +  int c, sc;
>    char *tok;
>  
>    if ((s = *stringp) == NULL)

Reviewed-by: Laszlo Ersek <lersek@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115600): https://edk2.groups.io/g/devel/message/115600
Mute This Topic: https://groups.io/mt/104402243/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



      reply	other threads:[~2024-02-19 20:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 21:46 [edk2-devel] [PATCH edk2-libc 1/1] StdLib: Remove the 'register' keyword from public interfaces Pedro Falcato
2024-02-19 20:27 ` Laszlo Ersek [this message]

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-list 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=2f3457fb-0370-af6d-1e85-d8d736fd9930@redhat.com \
    --to=devel@edk2.groups.io \
    /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