MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
291 stars 179 forks source link

Avoid using reserved identifiers by the C++ standard #2862

Open daljit46 opened 6 months ago

daljit46 commented 6 months ago

There are many instances in our codebase (e.g. pretty much all include guards) where variables are declared beginning with a double underscore. As pointed out by clang-tidy(bugprone-reserved-identifier), this results in undefined behaviour since the C++ standard reserves all identifiers beginning with a double underscore.

Lestropie commented 6 months ago

Would you suggest renaming the wrapper #ifndef's, or switch to using #pragma once?

daljit46 commented 6 months ago

My preference would be to use #pragma once because I think header guards are ugly. While #pragma once is not strictly in the standard, it's virtually supported by all compilers in existence.