[tor-bugs] #17161 [Tor]: Conform to C++ Core Guidelines for C?

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Sep 25 15:51:51 UTC 2015


#17161: Conform to C++ Core Guidelines for C?
-------------------------+-------------------------------------------------
     Reporter:           |      Owner:
  mikeperry              |     Status:  new
         Type:           |  Milestone:
  enhancement            |    Version:
     Priority:  normal   |   Keywords:  028-triage security flamewar
    Component:  Tor      |  holywar jihad Coup++ seriously-not-trolling-
   Resolution:           |  xkeyscore
Actual Points:           |  Parent ID:
       Points:           |
-------------------------+-------------------------------------------------

Comment (by isis):

 Replying to [comment:1 nickm]:
 > Hm. My first thought is that I don't mind renaming variables like
 'class' and 'private', but that implicit-cast-to-void* and implicit-cast-
 from-void* are my friends and I would hate to have to euthanize them.

 Would it work to just find whichever g++ flag to relax the errors for now,
 and then start requiring casts in new code to be explicit?

 -----

 Rather than compile it all with g++, the way I imagined that this would be
 done is use g++/gcc to separately compile the different parts of the code,
 then link the object files, and place the following restrictions for each
 set of code:

  * C++ people need to provide well-written, externed, C-like functions for
 the C people to use.
  * C people need to be extra careful to deal with pointers to C++ safely.

 And probably several other restrictions/conventions for both.
 Unfortunately, this sort of requires all C++ people to be good ABI
 designers… which… seems overly-optimistic. And it requires the C people to
 read C++ everytime they want to use something from it… which seems unfair.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17161#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list