[compiler-rt] r231965 - Refactor float to integer conversion to share the same code.

Justin Bogner mail at justinbogner.com
Thu Mar 12 16:49:04 PDT 2015


(Accidentally dropped the list, adding it back)

Joerg Sonnenberger <joerg at britannica.bec.de> writes:
> On Thu, Mar 12, 2015 at 03:19:02PM -0700, Justin Bogner wrote:
>> Joerg Sonnenberger <joerg at britannica.bec.de> writes:
>> > On Thu, Mar 12, 2015 at 12:09:56PM -0700, Justin Bogner wrote:
>> >> Joerg Sonnenberger <joerg at bec.de> writes:
>> >> > Author: joerg
>> >> > Date: Wed Mar 11 16:13:56 2015
>> >> > New Revision: 231965
>> >> >
>> >> > URL: http://llvm.org/viewvc/llvm-project?rev=231965&view=rev
>> >> > Log:
>> >> > Refactor float to integer conversion to share the same code.
>> >> > 80bit Intel/PPC long double is excluded due to lacking support
>> >> > for the abstraction. Consistently provide saturation logic.
>> >> > Extend to long double on 128bit IEEE extended platforms.
>> >> 
>> >> I'm getting warnings after this change. Apparently the C grammar doesn't
>> >> like empty TUs:
>> >> 
>> >> ../llvm/projects/compiler-rt/lib/builtins/fixunssfti.c:23:7: error:
>> >> ISO C requires a translation unit to contain at least one
>> >> declaration [-Werror,-Wempty-translation-unit]
>> >
>> > Which compiler with which flags? Note that we use the same logic e.g. in
>> > addtf3.c too.
>> 
>> I got this with a recent clang trunk, but also happens with 3.6 (and
>> presumably anything 3.2 or newer, this warning's been around for a
>> while). I was hitting this on a normal cmake release+asserts build, but
>> the only flag you actually need to reproduce is -pedantic:
>> 
>>   % clang -Werror -pedantic -c /Users/bogner/code/llvm/projects/compiler-rt/lib/builtins/fixunssfti.c
>>   /Users/bogner/code/llvm/projects/compiler-rt/lib/builtins/fixunssfti.c:23:7: error:
>>         ISO C requires a translation unit to contain at least one declaration
>>         [-Werror,-Wempty-translation-unit]
>
> As I said, we already use this logic in addtf3.c. Frankly, I consider
> -pedantic to be broken...

I guess this warning doesn't trigger on addtf3.c because it includes
"fp_lib.h" before doing nothing? In any case, I'm only complaining
because this is breaking my -Werror builds.

I'd be perfectly happy with using -Wno-empty-tranlation-unit as a
solution to this, as I can't really see how this particular warning
would ever be helpful. I don't know the history on using -pedantic in
our builds, but it seems to be the status quo so I'd be more hesitant to
change that.



More information about the llvm-commits mailing list