public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] Using ekd2-libc with C++20
@ 2024-02-16 10:00 pawel.karczewski via groups.io
  2024-02-16 17:26 ` Michael D Kinney
  2024-02-16 20:06 ` Pedro Falcato
  0 siblings, 2 replies; 7+ messages in thread
From: pawel.karczewski via groups.io @ 2024-02-16 10:00 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1391 bytes --]

Hi,

I'm successfully building C++20 project with edk2 under the GCC compiler.
Currently I'm trying to add edk2-libc to this project, but encountered issue with <string.h> header.

```
edk2/StdLib/Include/string.h:487:19: error: ISO C++17 does not allow ‘register’ storage class specifier [-Werror=register] register char **stringp
```

Why `strsep(register char **stringp, register const char *delim)` parameters has register storage class-class specifier?
C standard states the `register` keyword is only hint for the compiler and the extent to which such
suggestions are effective is implementation-defined. Do you see any real performance improvements thanks to this?

As I can see FreeBSD libc and musl do not have `register` keyword in signature of this function.

How do you think, may we remove `register` keyword from headers in Include directory?

Second option I see is to add
```
#ifdef __cplusplus
#define register
#endif
```

Of course I may submit patch for this change.

Paweł


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



[-- Attachment #2: Type: text/html, Size: 2162 bytes --]

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

end of thread, other threads:[~2024-02-17  2:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-16 10:00 [edk2-devel] Using ekd2-libc with C++20 pawel.karczewski via groups.io
2024-02-16 17:26 ` Michael D Kinney
2024-02-16 20:02   ` Pedro Falcato
2024-02-16 20:06 ` Pedro Falcato
2024-02-16 20:48   ` Michael D Kinney
2024-02-16 21:29     ` Michael D Kinney
2024-02-17  2:09   ` Pedro Falcato

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