ARM-software / CMSIS-DSP

CMSIS-DSP embedded compute library for Cortex-M and Cortex-A
https://arm-software.github.io/CMSIS-DSP
Apache License 2.0
518 stars 133 forks source link

reserved identifier violation #132

Closed elfring closed 3 months ago

elfring commented 10 months ago

I would like to point out that identifiers like “_MATRIX_UTILS_H_” and “_TRANSFORM_FUNCTIONS_H_do not fit to the expected naming convention of the C++ language standard. Would you like to adjust your selection for unique names?

christophe0606 commented 10 months ago

@elfring Have you observed any name clash with reserved names ?

elfring commented 10 months ago

:thought_balloon: How do you think about to avoid that this software depends on undefined behaviour?

escherstair commented 7 months ago

According to C standard, rule 7.1.3 states

Do not declare or define a reserved identifier All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use. All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces. Each macro name in any of the following subclauses (including the future library directions) is reserved for use as specified if any of its associated headers is included, unless explicitly stated otherwise. All identifiers with external linkage (including future library directions) and errno are always reserved for use as identifiers with external linkage. Each identifier with file scope listed in any of the following subclauses (including the future library directions) is reserved for use as a macro name and as an identifier with file scope in the same name space if any of its associated headers is included.

I would appreciate if CMSIS DSP headers could be made compliant to this rule.

christophe0606 commented 3 months ago

Done in commit https://github.com/ARM-software/CMSIS-DSP/commit/69d4b8ed8d3271facb2daff94216f7981774e816

elfring commented 3 months ago

:crystal_ball: Do name conventions for C++ code matter for your software?