Re: [cfe-users] cfe-users Digest, Vol 63, Issue 2

2018-04-03 Thread degski via cfe-users
On 2 April 2018 at 14:00, via cfe-users  wrote:

>
> > 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?
>

A hex value is unsigned by definition, so attaching "LL" to the end won't
work. The prototype of _mm_add_epi32  (a.o.) has the ints as signed. So,
the answer is to just c-cast the hex values to long long (AFAICS), or
suppress the warning.

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


[cfe-users] clang-format question

2018-04-03 Thread Mauricio Scaff via cfe-users
Hi, I'm new to the list.
Started using the code formatter and have a question about it.

With respct to the "spacebeforeparens" key, I couldn't find an option to
let me put an space before function declarations, but not in function
calls. Is there something I'm missing?

I'd like to do like this:

void myfunction (int myparam);  // space here

void myfunction (int myparam) {  // space here
.
.
.
}


void main (void) {
  myfunction(5); // no space here
}


Sorry if I'm missing something obvious.

Thanks,
Mauricio Scaff
___
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users