Fix warnings (C99; local snprintf() and math functions)#343
Fix warnings (C99; local snprintf() and math functions)#343jimklimov merged 2 commits intonetworkupstools:masterfrom
Conversation
|
I am still a little confused as to how |
|
Me neither (comments in configure.ac are not helpful in this regard) but it gets added to LTLIBOBJS on both Debian8 and OpenIndiana Hipster, both pretty modern. Maybe an oversight in configure.ac logic, that bit I did not deal with so far - just glanced where the object-file conflicts grow from... |
|
Do you have the following in the I don't think I have ltdl installed on the Buildbot debian8 slave system, so that might be one difference. |
|
Looking at ... and the relevant logs: and here is some, I guess, from OI hipster: Looking at it more, the only builds which failed for me (on both platforms) were the But still, for such a use-case of some ancient OS (or something that otherwise builds like one) there was an issue and now it's plumbed ;) |
32e826b to
62f1c0e
Compare
…rash due to padded ints in variadic functions
62f1c0e to
5adaf1e
Compare
|
Rebased over today's master to take advantage of new Travis CI integration. |
|
@clepple : are there any objections to merging this PR? |
|
Still curious as to why the fallback |
|
Not fully certain. Probably some macros did not get set in the OpenIndiana build case. At least, the routine is optionally defined on Solarish platforms (like many other similar bits in headers), so without explicit declaration that you want new features, it does what legacy software expected: |
|
So? :) Put another way, does merging this break anything (proven or anticipated)? |
|
The goal of zero warnings is noble, but patching a local version of Would be nice to add some of the notes about enabling C99 to the documentation, I guess, but not strictly required. Either way, I'm going to add to the PR title so we can find this discussion in the future if any issues crop up. |
|
Recommendation 3.3 at http://networkupstools.org/docs/developer-guide.chunked/ar01s03.html essentially suggests C89/C90 if not older (ok, there ain't older ;) ) |
|
Also, the goal of zero warnings is indeed a goal, because NUT uses Anyhow, now that this is renamed for easier tracking in the future, can it be merged to clean up the queue? ;p |
|
Anyhow, now that this is renamed for easier tracking in the future, can it be merged to clean up the queue? ;p
Yes
|
|
Thanks :) Done! 👍 |
|
@jimklimov not to beat a dead horse, but IPMI is one case where the effort needed to suppress all warnings is not worth it. I can't find the exact versions now, but one of the FreeIPMI versions returns values as unsigned, and another returns signed. Since we are looking for positive voltages, it doesn't affect the code. Rather than using Many of the developer recommendations listed as portability issues are no longer applicable as such, but note that the style is based off of K&R C. The original author intermingled style and portability guidelines in that section, and while I feel a twinge of shame for not trying to update that, the things I consider readable can be traced back to K&R as well. If the guidelines need to be updated to take advantage of progress since C89, then that is the discussion we should be having, rather than trying to play a metrics game with the warnings count. |
For kicks I configured and built with "-Wall -Werror"... and the build died on me, on several OSes. So this is a proposed fix, as far as syntax is concerned. Testing desired (that strings are still printed as they should be), and running on the buildbot farm should be useful too ;)