openh264 icon indicating copy to clipboard operation
openh264 copied to clipboard

reserved identifier violation

Open elfring opened this issue 12 years ago • 8 comments

I would like to point out that identifiers like "_WELSVP_WELSFRAMEWORK_H" and "_WELSVP_IMAGEROTATE_H" do not fit to the expected naming convention of the C++ language standard. Would you like to adjust your selection for unique names?

elfring avatar Dec 10 '13 20:12 elfring

This identifiers is used as define guard for header file include, What's is your suggestion to name those guards for C++ standard fitting? Thanks.

volvet avatar Dec 12 '13 08:12 volvet

should we use #pragma once instead of include guards?

andreasgal avatar Dec 12 '13 14:12 andreasgal

I would like to add another thought for your interest in the construct "#pragma once". How do you think about to reuse also a name pattern like it is applied in other projects?

elfring avatar Dec 12 '13 14:12 elfring

You just need to remove leading underscores to avoid pedantic concerns about identifier names reserved by the C or C++ standards.

#pragma once is not standardized and may be confused by symlinks or case insensitive file systems.

cpeterso avatar Dec 12 '13 22:12 cpeterso

We will not have symlinks or case sensitive collisions. Lets be pragmatic and sufficient, not precise and puritan.

andreasgal avatar Dec 12 '13 22:12 andreasgal

I'm not overly worried about case collisions, and while we do have some name duplication, we are working to remove that. With that said, I would prefer to stick with standard C++ and so use standard include guards rather than #pragma once.

I agree we should eventually replace these include guards with ones that don't have leading underscores.

ekr avatar Dec 12 '13 22:12 ekr

I agree with EKR that we should probably just remove the leading underscores.

ethanhugg avatar Dec 13 '13 17:12 ethanhugg

How do you think about to delete an underscore also from an identifier like "_WelsLogicalProcessorInfo"?

elfring avatar Aug 30 '15 07:08 elfring