Skip to content

Build warnings, potential bugs #11

@sambrightman

Description

@sambrightman

When building FREEC with a modern toolchain, I see quite a few suspicious warnings:

https://gist.github.com/sambrightman/dbb4b3d3e260672b0ed57a89c8869c79

  • the first == instead of = looks like a clear bug
  • some of the later assignment in place of comparison looks intentional but useless (value not used) - perhaps good to avoid this in at least most places?
  • without knowing the code, some of the &&/|| precedence issues look okay but some look suspicious (probably best to clarify all of them with parentheses)
  • lots of unused variables clutter the output, which hinders identification of real issues.

For me the compiler is:

[sam@Sams-MacBook-Pro src ((776efec...) *%)]$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

but recent versions of GCC should also warn about such things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions