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
libgis: Use the full string length in strncmp() calls. #1060
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that makes sense. Thanks for fixing it.
I'm curious how you discovered those. If it is a tool, we usually try to record that in the commit message (like "this fixes GGC warning foo-bar").
It was not a tool. I was following the existing code in On this note, the current build process does not enable all the warnings that GCC supports. For example, nothing pops up for unused function parameters and missing initializations. If you would like to consider a build system with more warnings enabled and support for multiple OSes and compilers, the work @guyharris and @fxlb had done in tcpdump build system is a good example. |
Thanks for looking also beyond open.c!
Right. Ideally, we would get most of those, e.g., whatever is default on Debian. Any changes in that regard are welcome. I set up standard check for C/C++ in GitHub Actions, but it is for GNU C, not ISO C, and it is not strict. We were able to significantly reduce issues in Python code recently, but more work is needed there too. Perhaps we can discuss this during the sprint.
It seems they are now using CMake. We have an open PR for CMake, but neither the OP nor myself touched it for some time. Also something to discuss more. |
Thank you. CMake is a relatively recent addition there, but I meant the autoconf way. If you remind me during the meeting, I can give a brief overview. |
libpcap and tcpdump now support both autotools and CMake for building. The primary reason to add CMake support was to add support for building on Windows in a fashion that wasn't Windows-only and could be maintained by people on UN*X systems. |
Good to know. Having CMake alongside Autotools was what we had in mind too. CMake seems to make a lot of sense. We actually do have a Windows build with autotools, but not with MSVC. |
The counts were off by one. Checking all characters now.
Here is a trivial bugfix, you might want to backport it too.