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

Add a coccinelle script to look for {inc,dec}rements in log_debug #1322

Merged
merged 1 commit into from Sep 25, 2019

Conversation

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

@nmathewson nmathewson commented Sep 11, 2019

Closes ticket 30743.

@coveralls
Copy link

@coveralls coveralls commented Sep 16, 2019

Pull Request Test Coverage Report for Build 6300

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 63.362%

Totals Coverage Status
Change from base Build 6286: 0.0%
Covered Lines: 47954
Relevant Lines: 75683

💛 - Coveralls

We want to forbid this pattern since, unlike the other log_*()
macros, log_debug() conditionally evaluates its arguments only if
debug-level logging is enabled.  Thus, a call to
    log_debug("%d", x++);
will only increment x if debugging logs are enabled, which is
probably not what the programmer intended.

One bug caused by this pattern was #30628.

This script detects log_debug( ) calls with any of E++, E--, ++E,
or --E in their arguments, where E is an arbitrary expression.

Closes ticket 30743.
@torproject-pusher torproject-pusher merged commit 387cfcc into torproject:master Sep 25, 2019
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment