Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #20168
Closed (moved) (moved)
Open
Issue created Sep 19, 2016 by David Goulet@dgoulet🐼

Clarify our #if{n}def by commenting what they are at the #elif/#else/#endif

Ok that's an easy one!

The idea is to improve our comments in the .h/.c files where we have a #ifdef BLAH and the corresponding #endif is at least a non negligible amount of lines after. Of course that goes without saying to also comment the #ifndef. Pattern would look like this:

#ifdef BLAH
[some non negligible amount of lines]
#elif /* BLAH */
[some other amount of lines]
#endif /* BLAH */

According to nickm, the current situation is:

Our headers have 27 #endifs with a comment, and 435 without.

Good example is or.h:

#ifndef TOR_OR_H
[5000+ lines in between]
#endif /* TOR_OR_H */

This file src/or/shared_random.h is a good example of what it could look like.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking