From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id E27587803E4 for ; Fri, 16 Feb 2024 14:46:12 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=pRcIGcb/gBZGTfNBAhgjZM5503i7JIJdO+/CqjEF3so=; c=relaxed/simple; d=groups.io; h=Subject:To:From:User-Agent:MIME-Version:Date:Message-ID:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20140610; t=1708094771; v=1; b=PXzx+qVRtBuSyHYMQ05aNF5WwnTr+btbWUebMfYopc28xZRQvuqJ344tviY1EaGuidE4i76k 5o5vu8Qfhx1Fecow1PSyy9RnlEWWvohzYNt0W/kHnRkxSk/JY5uP2+XgcazBXXnKYNQZcr6rky2 giyCUWGZUHe4FcfRnv3Gbs5Q= X-Received: by 127.0.0.2 with SMTP id EjutYY7687511xP9fwfyKX8u; Fri, 16 Feb 2024 06:46:11 -0800 Subject: [edk2-devel] Using ekd2-libc with C++20 To: devel@edk2.groups.io From: "pawel.karczewski via groups.io" X-Originating-Location: Warsaw, Mazovia, PL (134.238.136.59) X-Originating-Platform: Windows Chrome 121 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Fri, 16 Feb 2024 02:00:23 -0800 Message-ID: Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pawel.karczewski@solidigm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: pU8q1c7pcEthErqDyGgrbvIIx7686176AA= Content-Type: multipart/alternative; boundary="dOfyaGNJliMA5g8ujTvf" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=PXzx+qVR; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io --dOfyaGNJliMA5g8ujTvf Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 issu= e with header. ``` edk2/StdLib/Include/string.h:487:19: error: ISO C++17 does not allow =E2=80= =98register=E2=80=99 storage class specifier [-Werror=3Dregister] register = char **stringp ``` Why `strsep(register char **stringp, register const char *delim)` parameter= s 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 pe= rformance improvements thanks to this? As I can see FreeBSD libc and musl do not have `register` keyword in signat= ure 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=C5=82 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --dOfyaGNJliMA5g8ujTvf Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Hi,
 
I'm successfully building C++20 project with edk2 under the GCC compil= er.
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 &= lsquo;register’ storage class specifier [-Werror=3Dregister] register= char **stringp
```
 
Why `strsep(register char **stringp, register const char *delim)` para= meters 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 re= al performance improvements thanks to this?
 
As I can see FreeBSD libc and musl do not have `register` keyword in s= ignature of this function.
 
How do you think, may we remove `register` keyword from headers in Inc= lude directory?
 
Second option I see is to add
```
#ifdef __cplusplus
#define register
#endif
```
 
Of course I may submit patch for this change.
 
Pawe=C5=82
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#115541) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--dOfyaGNJliMA5g8ujTvf--