Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug34078 master #1883

Closed
wants to merge 11 commits into from
Closed

Bug34078 master #1883

wants to merge 11 commits into from

Conversation

Labels
None yet
Projects
None yet
4 participants
@nmathewson
Copy link
Contributor

@nmathewson nmathewson commented May 6, 2020

No description provided.

nmathewson added 11 commits May 6, 2020
This macro defers to __attribute__((fallthrough)) on GCC (and
clang).  Previously we had been using GCC's magic /* fallthrough */
comments, but clang very sensibly doesn't accept those.

Since not all compiler recognize it, we only define it when our
configure script detects that it works.

Part of a fix for 34078.
GCC added an implicit-fallthrough warning a while back, where it
would complain if you had a nontrivial "case:" block that didn't end
with break, return, or something like that.  Clang recently added
the same thing.

GCC, however, would let you annotate a fall-through as intended by
any of various magic "/* fall through */" comments.  Clang, however,
only seems to like "__attribute__((fallthrough))".  Fortunately, GCC
accepts that too.

A previous commit in this branch defined a FALLTHROUGH macro to do
the right thing if GNUC is defined; here we replace all of our "fall
through" comments with uses of that macro.

This is an automated commit, made with the following perl one-liner:

  #!/usr/bin/perl -i -p
  s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
@coveralls
Copy link

@coveralls coveralls commented May 6, 2020

Pull Request Test Coverage Report for Build 8852

  • 0 of 13 (0.0%) changed or added relevant lines in 6 files are covered.
  • 49696 unchanged lines in 322 files lost coverage.
  • Overall coverage decreased (-64.2%) to 0.0%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/app/config/quiet_level.c 0 1 0.0%
src/core/or/reasons.c 0 1 0.0%
src/core/proto/proto_socks.c 0 1 0.0%
src/feature/control/control_cmd.c 0 1 0.0%
src/lib/crypt_ops/crypto_digest_openssl.c 0 2 0.0%
src/ext/csiphash.c 0 7 0.0%
Files with Coverage Reduction New Missed Lines %
src/core/mainloop/connection.h 2 0%
src/core/mainloop/periodic.h 2 0%
src/core/or/channel.h 2 0%
src/core/or/orconn_event.h 2 0%
src/feature/dirauth/shared_random.h 2 0%
src/feature/nodelist/routerlist.h 2 0%
src/feature/relay/circuitbuild_relay.h 2 0%
src/feature/rend/rendcache.h 2 0%
src/lib/net/gethostname.c 2 0%
src/lib/time/compat_time.h 2 0%
Totals Coverage Status
Change from base Build 8846: -64.2%
Covered Lines: 0
Relevant Lines: 78106

💛 - Coveralls

Copy link
Member

@ahf ahf left a comment

One minor comment.

@@ -196,7 +196,7 @@ hs_dos_can_send_intro2(or_circuit_t *s_intro_circ)
goto allow;
}

/* Fallthrough is to disallow since this means the bucket has reached 0. */
FALLTHROUGH;
Copy link
Member

@ahf ahf May 6, 2020

The comment is lost here.

@torproject-pusher torproject-pusher deleted the branch torproject:master May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment