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 060EDD802AD for ; Sat, 17 Feb 2024 02:10:01 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dl9mzpTyNzmWdjh1vjYJr8IsSH72pA7WMgMHQ39k84g=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1708135800; v=1; b=VhcUyc0foz3OrDe/kam28VUzchYujrqBK3uoeq0vj4afEBFoAgwURwG4UjHxF0FyC9yC58pj 03m5Ko5JDxUztL/gmSyvuASdnnIbzl8iV9RWL31UPVecwzEcwKVlXJjkiRqjHA0RQ00HtSQf7P7 D33Nk0ExZNqerCtuz42Onxc8= X-Received: by 127.0.0.2 with SMTP id A8lnYY7687511xYBzkL08oCx; Fri, 16 Feb 2024 18:10:00 -0800 X-Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com [209.85.222.52]) by mx.groups.io with SMTP id smtpd.web11.2562.1708135800074581431 for ; Fri, 16 Feb 2024 18:10:00 -0800 X-Received: by mail-ua1-f52.google.com with SMTP id a1e0cc1a2514c-7d5bbbe592dso1356393241.0 for ; Fri, 16 Feb 2024 18:09:59 -0800 (PST) X-Gm-Message-State: WQpKejnuQYbZWPm9IIFyFEUNx7686176AA= X-Google-Smtp-Source: AGHT+IH+wgfWrwqZD9MlGTZfI7nd7n4lV1ftc5dNPmkToXxKywKiB8AdTMCeXWzfj4v/VPbUFSWsr0sX3VBFWFRSZk4= X-Received: by 2002:a05:6122:2221:b0:4c7:5fee:f525 with SMTP id bb33-20020a056122222100b004c75feef525mr1841581vkb.13.1708135798812; Fri, 16 Feb 2024 18:09:58 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Pedro Falcato" Date: Sat, 17 Feb 2024 02:09:47 +0000 Message-ID: Subject: Re: [edk2-devel] Using ekd2-libc with C++20 To: devel@edk2.groups.io, pawel.karczewski@solidigm.com 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,pedro.falcato@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=VhcUyc0f; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) On Fri, Feb 16, 2024 at 8:06=E2=80=AFPM Pedro Falcato wrote: > > On Fri, Feb 16, 2024 at 2:46=E2=80=AFPM pawel.karczewski via groups.io > wrote: > > > > Hi, > > > > I'm successfully building C++20 project with edk2 under the GCC compile= r. > > Currently I'm trying to add edk2-libc to this project, but encountered = issue 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] reg= ister char **stringp > > ``` > > > > Why `strsep(register char **stringp, register const char *delim)` param= eters 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 rea= l performance improvements thanks to this? > > Considering the file is Copyright(C) University of California (and the > SCCS tags suggest 1993, which places it around 4.4BSD), this very much > looks like a historical artifact (of old UNIX and bad compilers). I > certainly doubt any compiler capable of building EDK2 changes its > codegen because of it (and certainly not the calling convention, at > least in all ABIs I know of). I was bored and had to check :) Old 4.4BSD string.h: https://www.tuhs.org/cgi-bin/utree.pl?file=3D4.4BSD/usr/src/include/string.= h So we can see that it didn't even have the register specifier in the declaration. However, in the definition: https://www.tuhs.org/cgi-bin/utree.pl?file=3D4.4BSD/usr/src/lib/libc/string= /strsep.c We can see that 'register' was present there, for what I assume was handholding the compiler into keeping the arg variables in registers on old UNIX (they did that *a lot*, even back in the original UNIX C versions). --=20 Pedro -=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 (#115564): https://edk2.groups.io/g/devel/message/115564 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-