Hi Shawn,

I've never compiled using HP's compiler, so take this for what its
worth....

On Mar 27, 5:52 pm, Shawn Firth <[email protected]> wrote:
> ...
> shacal2.cpp
> "misc.h", line 538: warning #4232-D: conversion from "CryptoPP::word32 *"
> to a
>           more strictly aligned type "CryptoPP::word64 *" may cause
> misaligned
>           access
>   SecureWipeBuffer((word64 *)buf, n * (sizeof(T)/8));
>                    ^
If I were going to tackle this, I would change the code or provide a
specialization:

    SecureWipeBuffer((word32 *)buf, n * (sizeof(T)/4));

GCC will catch these with -Wcast-align, but I don't believe Crypto++
uses it by default. I suspect its because x86 is very tolerant of
misaligned data, so the flag was never needed to preempt the SIGBUS
that could result.

> "misc.h", line 414: warning #2186-D: pointless comparison of unsigned
> integer
>           with zero
>   if (a < 0)
>         ^
>           detected during instantiation of "std::string
>                     CryptoPP::IntToString(T, unsigned int) [with T=unsigned
>                     long]" at line 35 of "simple.h"
>

This is due to an unsigned type with template code. It works fine with
signed types.

    template <class T>
    Foo<T>::someMethod(T t)
    {
        if(t < 0)
            ....
    }

For GCC, you can suppress the warning with -Wno-type-limits. Under
Clang, you would use -Wno-tautological-compare. I'm not sure what you
would use under HP's compiler.

> shark.cpp
> "secblock.h", line 39: warning #4276-D: relational operator ">" always
>           evaluates to 'false'
>   if (n > ~size_t(0) / sizeof(T))
>         ^
I'm not sure what to do here since I've never encountered it. Perhaps
a template specialization while removing the offending code?

> "seckey.h", line 50: warning #4276-D: relational operator ">" always
> evaluates
>           to 'false'
>   if (rounds < MIN_ROUNDS || rounds > MAX_ROUNDS)
>                                     ^
Ditto. You should see a lot of these (MIN_ROUNDS, BLOCKSIZE,
DEFAULT_KEYLENGTH, ...) since they are enumerations and static
constants.

Jeff

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to