#19 reserved identifier violation

closed
nobody
None
5
2012-11-10
2012-04-30
No

I suggest to try the search pattern "\<_(?:(?:_(.*))|([A-Z]+))" on source files.
Some places will be found where names begin with two underscores or an underscore and an uppercase letter.

Examples:
- _GLEST_GAME_AI_H_
http://megaglest.git.sourceforge.net/git/gitweb.cgi?p=megaglest/megaglest-source;a=blob;f=source/glest_game/ai/ai.h;hb=730d3a247c018340a14cede1f85a8cf98ac637b9#l12

- _SHADER_G3DVIEWER_RENDERER_H_
http://megaglest.git.sourceforge.net/git/gitweb.cgi?p=megaglest/megaglest-source;a=blob;f=source/g3d_viewer/renderer.h;hb=d4065bc9634c829a9b0790ccee2807ee47236056#l12

This usage does not fit to the expected naming conventions of the C/C++ language standard.
https://www.securecoding.cert.org/confluence/display/cplusplus/DCL32-CPP.+Do+not+declare+or+define+a+reserved+identifier#DCL32-CPP.Donotdeclareordefineareservedidentifier-NoncompliantCodeExample%28HeaderGuard%29

I recommend to adjust your selection for unique names.

Discussion

  • Mark Vejvoda

    Mark Vejvoda - 2012-07-13

    Not sure why this would be important other than creating more work for little gain?

     
  • Markus Elfring

    Markus Elfring - 2012-07-13

    Does this source code benefit if it would become a bit more standard-compliant?

     
  • Mark Vejvoda

    Mark Vejvoda - 2012-11-10

    We won't be changing all of these, it really does nothing of value.

     
  • Mark Vejvoda

    Mark Vejvoda - 2012-11-10
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks