Thread (5 messages) 5 messages, 5 authors, 2021-11-26

Re: [dpdk-dev] [PATCH] devtools: forbid additions of __reserved

From: Tyler Retzlaff <hidden>
Date: 2021-11-11 05:45:21

On Sat, Oct 23, 2021 at 12:29:00PM +0200, David Marchand wrote:
__reserved is a reserved keyword in Windows system headers.
fwiw it's the c standard that stipulates identifiers starting with __
are reserved for any use.

C11/C99 "ANSI-C"
7.1.3 Reserved Identifiers
    `All identifiers that begin with an underscore and either an
    uppercase letter or another underscore are always reserved for
    any use.'

Public DPDK headers are also subject to the C++ standard.
C++ (n3690)
5.10 Identifiers

    `(3.1) -- Each identifier that contains a double underscore __ or
    begins with an underscore followed by an uppercase letter is reserved
    to the implementation for any use.'

    `(3.2) -- Each identifier that begins with an underscore is reserved
    to the implementation for use as a name in the global namespace.'

dpdk is pretty comprehensive in violating these clauses with
identifiers of the form `__rte_’ fortunately since preprocessors,
compilers, standard library headers are unlikely to use `rte’ it’s
fairly safe in spite of being non-compliant.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help