-Wregister (C++ and Objective-C++ only)
Warn on uses of the register storage class specifier, except when it is part of 
the GNU Variables in Specified Registers extension. The use of the register 
keyword as storage class specifier has been deprecated in C++11 and removed in 
C++17. Enabled by default with -std=c++17.


I think adding -Wno-register to [BuildOptions] for GCC CC_FLAGS in 
edk2-libc/StdLib/StdLib.inc may help.

Mike


> -----Original Message-----
> From: Kinney, Michael D <michael.d.kin...@intel.com>
> Sent: Friday, February 16, 2024 12:49 PM
> To: devel@edk2.groups.io; pedro.falc...@gmail.com;
> pawel.karczew...@solidigm.com
> Cc: Kinney, Michael D <michael.d.kin...@intel.com>
> Subject: RE: [edk2-devel] Using ekd2-libc with C++20
> 
> The other option is update build to ignore -Werror=register
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Pedro
> > Falcato
> > Sent: Friday, February 16, 2024 12:06 PM
> > To: devel@edk2.groups.io; pawel.karczew...@solidigm.com
> > Subject: Re: [edk2-devel] Using ekd2-libc with C++20
> >
> > On Fri, Feb 16, 2024 at 2:46 PM pawel.karczewski via groups.io
> > <pawel.karczewski=solidigm....@groups.io> wrote:
> > >
> > > 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?
> >
> > 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).
> >
> > --
> > Pedro
> >
> >
> > 
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115558): https://edk2.groups.io/g/devel/message/115558
Mute This Topic: https://groups.io/mt/104393456/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to