mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
mirror repository of the tor core protocol in case of issues
bb465be085
On GCC and Clang, there's a feature to warn you about bad conditionals like "if (a = b)", which should be "if (a == b)". However, they don't warn you if there are extra parentheses around "a = b". Unfortunately, the tor_assert() macro and all of its kin have been passing their inputs through stuff like PREDICT_UNLIKELY(expr) or PREDICT_UNLIKELY(!(expr)), both of which expand to stuff with more parentheses around "expr", thus suppressing these warnings. To fix this, this patch introduces new macros that do not wrap expr. They're only used when GCC or Clang is enabled (both define __GNUC__), since they require GCC's "({statement expression})" syntax extension. They're only used when we're building the unit-test variant of the object files, since they suppress the branch-prediction hints. I've confirmed that tor_assert(), tor_assert_nonfatal(), tor_assert_nonfatal_once(), BUG(), and IF_BUG_ONCE() all now give compiler warnings when their argument is an assignment expression. Fixes bug 27709. Bugfix on 0.0.6, where we first introduced the "tor_assert()" macro. |
||
---|---|---|
changes | ||
contrib | ||
doc | ||
m4 | ||
scripts | ||
src | ||
.editorconfig | ||
.gitignore | ||
.travis.yml | ||
acinclude.m4 | ||
autogen.sh | ||
ChangeLog | ||
configure.ac | ||
Doxyfile.in | ||
INSTALL | ||
LICENSE | ||
Makefile.am | ||
Makefile.nmake | ||
README | ||
ReleaseNotes |
Tor protects your privacy on the internet by hiding the connection between your Internet address and the services you use. We believe Tor is reasonably secure, but please ensure you read the instructions and configure it properly. To build Tor from source: ./configure && make && make install To build Tor from a just-cloned git repository: sh autogen.sh && ./configure && make && make install Home page: https://www.torproject.org/ Download new versions: https://www.torproject.org/download/download.html Documentation, including links to installation and setup instructions: https://www.torproject.org/docs/documentation.html Making applications work with Tor: https://wiki.torproject.org/projects/tor/wiki/doc/TorifyHOWTO Frequently Asked Questions: https://www.torproject.org/docs/faq.html To get started working on Tor development: See the doc/HACKING directory.