Skip to content
Snippets Groups Projects
Forked from The Tor Project / Core / Tor
Source project has a limited visibility.
  • Nick Mathewson's avatar
    7faf115d
    Change all SMARTLIST_FOREACH loops of >=10 lines to use BEGIN/END · 7faf115d
    Nick Mathewson authored
    The SMARTLIST_FOREACH macro is more convenient than BEGIN/END when
    you have a nice short loop body, but using it for long bodies makes
    your preprocessor tell the compiler that all the code is on the same
    line.  That causes grief, since compiler warnings and debugger lines
    will all refer to that one line.
    
    So, here's a new style rule: SMARTLIST_FOREACH blocks need to be
    short.
    7faf115d
    History
    Change all SMARTLIST_FOREACH loops of >=10 lines to use BEGIN/END
    Nick Mathewson authored
    The SMARTLIST_FOREACH macro is more convenient than BEGIN/END when
    you have a nice short loop body, but using it for long bodies makes
    your preprocessor tell the compiler that all the code is on the same
    line.  That causes grief, since compiler warnings and debugger lines
    will all refer to that one line.
    
    So, here's a new style rule: SMARTLIST_FOREACH blocks need to be
    short.