Re: [tip:x86/urgent] x86/tools: Fix gcc-7 warning in relocs.c

2016-12-20 Thread H. Peter Anvin
On 12/20/16 11:31, Markus Trippelsdorf wrote: > > 7.24.1(2) > »Where an argument declared as size_t n specifies the length of the > array for a function, n can have the value zero […] pointer arguments on > such a call shall still have valid values, as described in 7.1.4.« > OK, fair enough.

Re: [tip:x86/urgent] x86/tools: Fix gcc-7 warning in relocs.c

2016-12-20 Thread Markus Trippelsdorf
On 2016.12.20 at 10:32 -0800, h...@zytor.com wrote: > On December 20, 2016 3:51:09 AM PST, Markus Trippelsdorf > wrote: > >On 2016.12.20 at 03:10 -0800, H. Peter Anvin wrote: > >> On 12/20/16 02:00, Markus Trippelsdorf wrote: > >> > On 2016.12.20 at 01:30 -0800, H. Peter Anvin wrote: > >> >> I'd

Re: [tip:x86/urgent] x86/tools: Fix gcc-7 warning in relocs.c

2016-12-20 Thread hpa
On December 20, 2016 3:51:09 AM PST, Markus Trippelsdorf wrote: >On 2016.12.20 at 03:10 -0800, H. Peter Anvin wrote: >> On 12/20/16 02:00, Markus Trippelsdorf wrote: >> > On 2016.12.20 at 01:30 -0800, H. Peter Anvin wrote: >> >> I'd strongly prefer a non-data-dependent solution, specifically >add

Re: [tip:x86/urgent] x86/tools: Fix gcc-7 warning in relocs.c

2016-12-20 Thread Markus Trippelsdorf
On 2016.12.20 at 03:10 -0800, H. Peter Anvin wrote: > On 12/20/16 02:00, Markus Trippelsdorf wrote: > > On 2016.12.20 at 01:30 -0800, H. Peter Anvin wrote: > >> I'd strongly prefer a non-data-dependent solution, specifically adding > >> at the top of sort_relocs(): > >> > >> if (!r->count) > >>

Re: [tip:x86/urgent] x86/tools: Fix gcc-7 warning in relocs.c

2016-12-20 Thread H. Peter Anvin
On 12/20/16 02:00, Markus Trippelsdorf wrote: > On 2016.12.20 at 01:30 -0800, H. Peter Anvin wrote: >> I'd strongly prefer a non-data-dependent solution, specifically adding >> at the top of sort_relocs(): >> >> if (!r->count) >> return; >> >> However, by my reading of the C and POSIX standard

Re: [tip:x86/urgent] x86/tools: Fix gcc-7 warning in relocs.c

2016-12-20 Thread Markus Trippelsdorf
On 2016.12.20 at 01:30 -0800, H. Peter Anvin wrote: > I'd strongly prefer a non-data-dependent solution, specifically adding > at the top of sort_relocs(): > > if (!r->count) > return; > > However, by my reading of the C and POSIX standards, this is a gcc > error: qsort() should do nothing if

Re: [tip:x86/urgent] x86/tools: Fix gcc-7 warning in relocs.c

2016-12-20 Thread H. Peter Anvin
I'd strongly prefer a non-data-dependent solution, specifically adding at the top of sort_relocs(): if (!r->count) return; However, by my reading of the C and POSIX standards, this is a gcc error: qsort() should do nothing if the count is zero. -hpa On 12/19/16 02:56, tip-bot fo