Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 319
    • Issues 319
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 36
    • Merge requests 36
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #20168
Closed
Open
Created Sep 19, 2016 by David Goulet@dgoulet🔆Owner

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