Re: some gcc warnings

2017-05-05 Thread Bruno Haible
> > Therefore I would propose to go with the union approach: > > Yes, that sounds like the best way to fix the problem now. Thanks for > explaining it. OK, I've pushed it. Bruno

Re: some gcc warnings

2017-05-05 Thread Paul Eggert
On 05/05/2017 09:30 AM, Bruno Haible wrote: Therefore I would propose to go with the union approach: Yes, that sounds like the best way to fix the problem now. Thanks for explaining it.

Re: some gcc warnings

2017-05-05 Thread Bruno Haible
By the way, the proposed patch not only fixes the gcc warnings about aliasing, but also the alignment issue: a declaration of a local variable char block[16]; does not ensure that 'block' will has the necessary alignment for uint32_t accesses. Bruno

Re: some gcc warnings

2017-05-05 Thread Bruno Haible
Hi Paul, > On 05/04/2017 03:24 PM, Bruno Haible wrote: > > https://dev.gnupg.org/rCf17d50bbd31b1faa24af1e46c10bba845becf585 > > https://dev.gnupg.org/rCdfb4673da8ee52d95e0a62c9f49ca8599943f22e > > > > But this fix is only effective for GCC. How could a compiler-independent fix > > look like? > >

Re: some gcc warnings

2017-05-04 Thread Paul Eggert
On 05/04/2017 03:24 PM, Bruno Haible wrote: https://dev.gnupg.org/rCf17d50bbd31b1faa24af1e46c10bba845becf585 https://dev.gnupg.org/rCdfb4673da8ee52d95e0a62c9f49ca8599943f22e But this fix is only effective for GCC. How could a compiler-independent fix look like? Why do we need a compiler-indepe

Re: some gcc warnings

2017-05-04 Thread Bruno Haible
Paul Eggert wrote on 2016-10-20: > I'll leave rijndael-api-fst.c for Simon. I'm still seeing the warnings with gcc-7.1: rijndael-api-fst.c: In function 'rijndaelBlockEncrypt': rijndael-api-fst.c:234:11: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasi

Re: fix some gcc warnings

2016-10-22 Thread Bruno Haible
Pádraig Brady wrote: > > 2016-10-16 Bruno Haible > > > > Fix some "gcc -Wall" warnings. > > * tests/test-ffsl.c (main): Use variable x, not i. > > * tests/test-posix_spawn3.c (parent_main): Consider the return value of > > freopen. > > * tests/test-sethostname1.c (main): Exp

Re: some gcc warnings

2016-10-20 Thread Paul Eggert
On 10/16/2016 08:06 AM, Bruno Haible wrote: test-quotearg.h:123:1: warning: 'use_quote_double_quotes' defined but not used [-Wunused-function] Do you see a simple and reliable way to correct or silence these warnings? For test-quotearg.h the attached patch (installed) should do the trick. I'

Re: fix some gcc warnings

2016-10-16 Thread Pádraig Brady
On 16/10/16 16:01, Bruno Haible wrote: > Hi, > > When I compile a gnulib testdir with "gcc -Wall", I see the following warnings > (among others): > > test-ffsl.c: In function 'main': > test-ffsl.c:44:12: warning: unused variable 'x' [-Wunused-variable] > > test-posix_spawn3.c: In function 'paren

some gcc warnings

2016-10-16 Thread Bruno Haible
Hi Paul, Simon, When I compile a gnulib testdir on a glibc system with "gcc -Wall", I see the following warnings (among others): rijndael-api-fst.c: In function 'rijndaelBlockEncrypt': rijndael-api-fst.c:234:11: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstric

fix some gcc warnings

2016-10-16 Thread Bruno Haible
Hi, When I compile a gnulib testdir with "gcc -Wall", I see the following warnings (among others): test-ffsl.c: In function 'main': test-ffsl.c:44:12: warning: unused variable 'x' [-Wunused-variable] test-posix_spawn3.c: In function 'parent_main': test-posix_spawn3.c:78:11: warning: ignoring ret

Re: thread: fix some gcc warnings

2011-07-08 Thread Bruno Haible
Eric Blake wrote: > > - (pthread_in_use () ? (void *) pthread_self () : NULL) > > + (pthread_in_use () ? pthread_self () : (pthread_t) NULL) > > This not portable. POSIX allows pthread_t to be a non-pointer type, so > you can't necessarily cast NULL to pthread_t. Yes, and the only platfo

Re: thread: fix some gcc warnings

2011-07-08 Thread Eric Blake
On 07/08/2011 05:27 AM, Bruno Haible wrote: > The statement > gl_thread_t t = gl_thread_self (); > gives a gcc warning about assignment from a pointer to an integer. This fixes > it: > > > 2011-07-08 Bruno Haible > > thread: Avoid gcc warnings when using gl_thread_self(). > * li

thread: fix some gcc warnings

2011-07-08 Thread Bruno Haible
The statement gl_thread_t t = gl_thread_self (); gives a gcc warning about assignment from a pointer to an integer. This fixes it: 2011-07-08 Bruno Haible thread: Avoid gcc warnings when using gl_thread_self(). * lib/glthread/thread.h (gl_thread_self): Return a pthread_t, no