mirror repository of the tor core protocol in case of issues
Go to file
Nick Mathewson bb465be085 Revise our assertion and bug macros to work with -Wparentheses
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.
2018-09-14 11:39:37 -04:00
changes Revise our assertion and bug macros to work with -Wparentheses 2018-09-14 11:39:37 -04:00
contrib Bump to 0.2.9.17-dev 2018-09-10 09:41:22 -04:00
doc man: Document default values if not in the consensus for DoS mitigation 2018-02-13 14:21:47 -05:00
m4 Use the Autoconf macro AC_USE_SYSTEM_EXTENSIONS 2016-06-17 10:17:44 -04:00
scripts Finally remove our EOL@EOF check. 2018-06-29 23:11:02 -04:00
src Revise our assertion and bug macros to work with -Wparentheses 2018-09-14 11:39:37 -04:00
.editorconfig Add .editorconfig to follow coding standards style 2018-06-17 19:24:40 -04:00
.gitignore Add TAGS to gitignore. 2016-10-03 14:08:50 -04:00
.travis.yml Merge remote-tracking branch 'teor/ticket27252-029' into maint-0.2.9 2018-09-11 13:08:57 -04:00
acinclude.m4 Resolve some warnings from OSX clang. 2016-06-11 10:11:53 -04:00
autogen.sh Use a nicely written autoconf macro to determine the sign of a type 2013-02-07 16:23:48 -05:00
ChangeLog Bump master to 0.2.9.4-alpha-dev 2016-10-17 16:31:40 -04:00
configure.ac Bump to 0.2.9.17-dev 2018-09-10 09:41:22 -04:00
Doxyfile.in Use output variables instead of relative paths. 2015-03-14 13:00:04 -04:00
INSTALL Small fixes for the 2702 implementation 2011-04-02 12:15:08 +02:00
LICENSE Add __mulodi4 source to src/ext 2016-05-18 09:44:01 -04:00
Makefile.am Test: avoid spurious failures in make test-network-all 2018-08-29 10:47:20 +10:00
Makefile.nmake Clean up the MVSC nmake files so they work again. 2014-09-09 10:27:05 -04:00
README Move hacking documentation into a new subdirectory. 2015-10-09 10:40:53 -04:00
ReleaseNotes release-notes for 0.2.8.9 2016-10-17 15:00:58 -04:00

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.