* [dpdk-dev] [PATCH] eal: remove register from function parameter in headers
@ 2020-05-08 23:25 Stephen Hemminger
2020-05-11 8:56 ` Burakov, Anatoly
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2020-05-08 23:25 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, pbhagavatula
Compiling a C++ application that includes directly or indirectly
rte_common.h will cause a warning:
include/rte_common.h:350:37: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
rte_combine32ms1b(register uint32_t x)
C++ pickier than standard C and flags this antique usage.
This is a bugfix please apply to 20.05.
The register keyword is an old K&R legacy and should be removed
everywhere in DPDK. For now, fix it where it hurts.
Checkpatch should also be able to flag use of register keyword.
Fixes: 08f683174e94 ("eal: add functions for previous power of 2 alignment")
Cc: pbhagavatula@caviumnetworks.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_eal/include/rte_common.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h
index 668e8b0af87d..0843ce69e7ec 100644
--- a/lib/librte_eal/include/rte_common.h
+++ b/lib/librte_eal/include/rte_common.h
@@ -409,7 +409,7 @@ __extension__ typedef uint64_t RTE_MARKER64[0];
* The combined value.
*/
static inline uint32_t
-rte_combine32ms1b(register uint32_t x)
+rte_combine32ms1b(uint32_t x)
{
x |= x >> 1;
x |= x >> 2;
@@ -431,7 +431,7 @@ rte_combine32ms1b(register uint32_t x)
* The combined value.
*/
static inline uint64_t
-rte_combine64ms1b(register uint64_t v)
+rte_combine64ms1b(uint64_t v)
{
v |= v >> 1;
v |= v >> 2;
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: remove register from function parameter in headers
2020-05-08 23:25 [dpdk-dev] [PATCH] eal: remove register from function parameter in headers Stephen Hemminger
@ 2020-05-11 8:56 ` Burakov, Anatoly
2020-05-11 9:04 ` Bruce Richardson
0 siblings, 1 reply; 4+ messages in thread
From: Burakov, Anatoly @ 2020-05-11 8:56 UTC (permalink / raw)
To: Stephen Hemminger, dev; +Cc: pbhagavatula
On 09-May-20 12:25 AM, Stephen Hemminger wrote:
> Compiling a C++ application that includes directly or indirectly
> rte_common.h will cause a warning:
>
> include/rte_common.h:350:37: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
> rte_combine32ms1b(register uint32_t x)
>
> C++ pickier than standard C and flags this antique usage.
>
> This is a bugfix please apply to 20.05.
> The register keyword is an old K&R legacy and should be removed
> everywhere in DPDK. For now, fix it where it hurts.
> Checkpatch should also be able to flag use of register keyword.
>
> Fixes: 08f683174e94 ("eal: add functions for previous power of 2 alignment")
> Cc: pbhagavatula@caviumnetworks.com
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
I remember similar patches already being submitted, and the community
has decided that 'register' keyword was worth keeping (although i don't
recall the reasoning). Has something changed since then?
--
Thanks,
Anatoly
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: remove register from function parameter in headers
2020-05-11 8:56 ` Burakov, Anatoly
@ 2020-05-11 9:04 ` Bruce Richardson
2020-05-18 16:30 ` David Marchand
0 siblings, 1 reply; 4+ messages in thread
From: Bruce Richardson @ 2020-05-11 9:04 UTC (permalink / raw)
To: Burakov, Anatoly; +Cc: Stephen Hemminger, dev, pbhagavatula
On Mon, May 11, 2020 at 09:56:10AM +0100, Burakov, Anatoly wrote:
> On 09-May-20 12:25 AM, Stephen Hemminger wrote:
> > Compiling a C++ application that includes directly or indirectly
> > rte_common.h will cause a warning:
> >
> > include/rte_common.h:350:37: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
> > rte_combine32ms1b(register uint32_t x)
> >
> > C++ pickier than standard C and flags this antique usage.
> >
> > This is a bugfix please apply to 20.05.
> > The register keyword is an old K&R legacy and should be removed
> > everywhere in DPDK. For now, fix it where it hurts.
> > Checkpatch should also be able to flag use of register keyword.
> >
> > Fixes: 08f683174e94 ("eal: add functions for previous power of 2 alignment")
> > Cc: pbhagavatula@caviumnetworks.com
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
>
> I remember similar patches already being submitted, and the community has
> decided that 'register' keyword was worth keeping (although i don't recall
> the reasoning). Has something changed since then?
>
I'm not sure anything has changed - and I don't see the need for register
keyword myself - but all headers must be includable in C++ code. Therefore
we need to remove register from rte_common.h
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: remove register from function parameter in headers
2020-05-11 9:04 ` Bruce Richardson
@ 2020-05-18 16:30 ` David Marchand
0 siblings, 0 replies; 4+ messages in thread
From: David Marchand @ 2020-05-18 16:30 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Burakov, Anatoly, dev, pbhagavatula, Bruce Richardson
On Mon, May 11, 2020 at 11:05 AM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Mon, May 11, 2020 at 09:56:10AM +0100, Burakov, Anatoly wrote:
> > On 09-May-20 12:25 AM, Stephen Hemminger wrote:
> > > Compiling a C++ application that includes directly or indirectly
> > > rte_common.h will cause a warning:
> > >
> > > include/rte_common.h:350:37: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
> > > rte_combine32ms1b(register uint32_t x)
> > >
> > > C++ pickier than standard C and flags this antique usage.
> > >
> > > This is a bugfix please apply to 20.05.
> > > The register keyword is an old K&R legacy and should be removed
> > > everywhere in DPDK. For now, fix it where it hurts.
> > > Checkpatch should also be able to flag use of register keyword.
> > >
> > > Fixes: 08f683174e94 ("eal: add functions for previous power of 2 alignment")
Cc: stable@dpdk.org
> > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Applied, thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-18 16:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 23:25 [dpdk-dev] [PATCH] eal: remove register from function parameter in headers Stephen Hemminger
2020-05-11 8:56 ` Burakov, Anatoly
2020-05-11 9:04 ` Bruce Richardson
2020-05-18 16:30 ` David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).