[botan-devel] Compiler warning going to Android NDK v10 from v9

William K. Foster wkf at alum.mit.edu
Wed Jan 14 13:15:54 EST 2015


Thanks John,

I can confirm that updating the v1.10.9 code to instead be:

               (0x0555555555555555*ULL* * i)) ^ H[(i-16+7)%16]);

Makes the warning go away.

Would someone that understands this code please confirm this is a proper
patch to the code and should it be applied to the prior loop that has the
same constant?

-William


On Tue, Jan 13, 2015 at 3:45 PM, john skaller <skaller at users.sourceforge.net
> wrote:

>
> On 14/01/2015, at 8:12 AM, William K. Foster wrote:
>
> > Hello,
> >
> > I've been building Botan v1.10.9 successfully for Android using the
> Native Development Kit v9, however, when I try to go to v10 of the NDK, I
> get the following warning:
> >
> > [armeabi] Compile++ thumb: botan <= botan_all.cpp
> > /Users/wkf/sds/flume/android/workspace/jni/botan/botan_all.cpp: In
> function 'void Botan::{anonymous}::BMW_512_compress(Botan::u64bit*, const
> u64bit*, Botan::u64bit*)':
> > /Users/wkf/sds/flume/android/workspace/jni/botan/botan_all.cpp:25863:36:
> warning: iteration 7u invokes undefined behavior
> [-Waggressive-loop-optimizations]
> >                 (0x0555555555555555 * i)) ^ H[(i-16+7)%16]);
>
> Shouldn't that constant be unsigned?
>
> BTW: gcc doesn't just make these warnings gratuitously, it actively
> exploits undefined behaviour to perform loop optimisations.
>
> --
> john skaller
> skaller at users.sourceforge.net
> http://felix-lang.org
>
>
>
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://lists.randombit.net/mailman/listinfo/botan-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20150114/0ff39e7b/attachment.html>


More information about the botan-devel mailing list