[llvm-bugs] [Bug 35728] [ARM code-gen] Not passing all parameters in printf call

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 16 14:50:55 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=35728

Andy Gibbs <andyg1001 at hotmail.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #4 from Andy Gibbs <andyg1001 at hotmail.co.uk> ---
You are right.  I just found this post:
https://www.embeddeduse.com/2013/08/25/casting-a-negative-float-to-an-unsigned-int

And its solution, -Wconversion, works.  The shame was that we always compile
code with -Wall -Wextra -Werror but it seems -Wall -Wextra still misses this
particular issue.

I, like the authors of the post, found myself hunting the most obscure of
problems.  In my case, the fact that at some point code evolution had led to
one part of code changing to float from unsigned without checking all the
places where the value was used, and yes, in one place deep in a corner it was
being implicitly converted to unsigned int and leaving a parameter passed to a
function in a state of flux.  It was one of those times when pure luck found
the issue.

I know this is a little out of scope here, but what is the way to turn on ALL
warnings in clang?  Or see which warnings are not trapped by -Wall or -Wextra. 
Even -Wpedantic doesn't pick this up!

I will mark this issue as solved.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181016/8815728d/attachment.html>


More information about the llvm-bugs mailing list