* [edk2-devel] [PATCH edk2-libc 1/1] StdLib: Remove the 'register' keyword from public interfaces
@ 2024-02-16 21:46 Pedro Falcato
2024-02-19 20:27 ` Laszlo Ersek
0 siblings, 1 reply; 2+ messages in thread
From: Pedro Falcato @ 2024-02-16 21:46 UTC (permalink / raw)
To: devel
Cc: Pedro Falcato, Rebecca Cran, Michael D Kinney, Jayaprakash N,
pawel.karczewski
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)
--
2.43.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115559): https://edk2.groups.io/g/devel/message/115559
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]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [edk2-devel] [PATCH edk2-libc 1/1] StdLib: Remove the 'register' keyword from public interfaces
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
0 siblings, 0 replies; 2+ messages in thread
From: Laszlo Ersek @ 2024-02-19 20:27 UTC (permalink / raw)
To: devel, pedro.falcato
Cc: Rebecca Cran, Michael D Kinney, Jayaprakash N, pawel.karczewski
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]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-19 20:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox