Re: [cfe-users] Problems with hexadecimal constant, _mm_set_epi64x and sign conversion

2018-04-02 Thread Matthew Fernandez via cfe-users
What version of Clang are you using? I cannot tell from the Travis config. I 
cannot reproduce this with -Wall -Wextra with any of the Clangs I happen to 
have on hand (3.8.0, 4.0.1, 5.0.0). 

> On 1 Apr 2018, at 12:00, via cfe-users  wrote:
> 
> Send cfe-users mailing list submissions to
>cfe-users@lists.llvm.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
> or, via email, send a message with subject or body 'help' to
>cfe-users-requ...@lists.llvm.org
> 
> You can reach the person managing the list at
>cfe-users-ow...@lists.llvm.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of cfe-users digest..."
> 
> 
> Today's Topics:
> 
>   1. Problems with hexadecimal constant,_mm_set_epi64x and sign
>  conversion (Jeffrey Walton via cfe-users)
> 
> 
> --
> 
> Message: 1
> Date: Sat, 31 Mar 2018 23:51:22 -0400
> From: Jeffrey Walton via cfe-users 
> To: "CFE-Users (Clang)" 
> Subject: [cfe-users] Problems with hexadecimal constant,
>_mm_set_epi64x and sign conversion
> Message-ID:
>
> Content-Type: text/plain; charset="UTF-8"
> 
> I'm having trouble with Travis during testing. The failed test is
> available at https://travis-ci.org/Tarsnap/scrypt/jobs/360781179.
> 
> Clang has rejected my attempts to use the constant (no suffix, ULL and LL):
> 
> MSG = _mm_add_epi32(MSG0, _mm_set_epi64x(0xE9B5DBA5B5C0FBCF,
> 0x71374491428A2F98));
> 
> MSG = _mm_add_epi32(MSG0, _mm_set_epi64x(0xE9B5DBA5B5C0FBCFULL,
> 0x71374491428A2F98ULL));
> 
> MSG = _mm_add_epi32(MSG0, _mm_set_epi64x(0xE9B5DBA5B5C0FBCFLL,
> 0x71374491428A2F98LL));
> 
> The message the compiler provides is:
> 
> crypto_sha256_shani.c:50:44: error: implicit conversion changes
> signedness: 'unsigned long' to 'long long' [-Werror,-Wsign-conversion]
> 
> The code came from Intel and I doubt it is defective.
> 
> How do I trick Clang to accept the hexadecimal value?
> 
> Thanks in advance.
> 
> 
> --
> 
> Subject: Digest Footer
> 
> ___
> cfe-users mailing list
> cfe-users@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
> 
> 
> --
> 
> End of cfe-users Digest, Vol 63, Issue 1
> 
___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


Re: [cfe-users] Problems with hexadecimal constant, _mm_set_epi64x and sign conversion

2018-04-02 Thread Jeffrey Walton via cfe-users
On Mon, Apr 2, 2018 at 12:30 PM, Matthew Fernandez via cfe-users
 wrote:
> What version of Clang are you using? I cannot tell from the Travis config. I 
> cannot reproduce this with -Wall -Wextra with any of the Clangs I happen to 
> have on hand (3.8.0, 4.0.1, 5.0.0).
>

I believe the Clang version is 5.0. I think you may need -Wsign-conversion.

The problem is being worked at https://github.com/Tarsnap/libcperciva/issues/44.

Also see https://github.com/Tarsnap/libcperciva/commit/7a3113828fd2

Jeff
___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users