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

Build warnings, potential bugs #11

Closed
sambrightman opened this issue Dec 7, 2016 · 3 comments · May be fixed by #12
Closed

Build warnings, potential bugs #11

sambrightman opened this issue Dec 7, 2016 · 3 comments · May be fixed by #12

Comments

@sambrightman
Copy link

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.

@valeu
Copy link
Contributor

valeu commented Dec 7, 2016

Yes, == was a bug. I corrected it 10 minutes ago :)
I have also removed some unused variables.
Thank you for your feedback.
The changes will appear in v10.3

@valeu
Copy link
Contributor

valeu commented Dec 9, 2016

I have cleaned the code a little bit in v10.2. and the "==" typo was fixed.

@valeu valeu closed this as completed Dec 9, 2016
sambrightman added a commit to sambrightman/FREEC that referenced this issue Dec 9, 2016
* convert some CR/LF line endings to LF
* be explicit about assignment operations within conditionals
* remove some unused variables
* add const to string literal argument types

Helps fix BoevaLab#11.
sambrightman added a commit to sambrightman/FREEC that referenced this issue Dec 9, 2016
* convert some CR/LF line endings to LF
* be explicit about assignment operations within conditionals
* remove some unused variables
* add const to string literal argument types

Helps fix BoevaLab#11.
@sambrightman
Copy link
Author

Great! I've done some more in #12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants