Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-05-19 Thread Peter Zijlstra
On Mon, Apr 25, 2022 at 04:07:43PM +0200, Christophe de Dinechin wrote: > >> extern struct sched_class __begin_sched_classes[]; > >> extern struct sched_class __end_sched_classes[]; > >> > >> -#define sched_class_highest (__end_sched_classes - 1) > >> +/* > >> + * sched_class_highests is really

Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-04-21 Thread Peter Zijlstra
On Wed, Apr 20, 2022 at 11:45:05AM -0700, Kees Cook wrote: > > -Wno-array-bounds > > Please no; we just spent two years fixing all the old non-flexible array > definitions and so many other things fixed for this to be enable because > it finds actual flaws (but we turned it off when it was

Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-04-20 Thread Kees Cook
On Sun, Apr 17, 2022 at 05:52:05PM +0200, Peter Zijlstra wrote: > On Thu, Apr 14, 2022 at 01:30:50PM -0700, Andrew Morton wrote: > > On Thu, 14 Apr 2022 17:21:01 +0200 Peter Zijlstra > > wrote: > > > > > > +/* The + 1 below places the pointers within the range of their array */ > > > > #define

Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-04-17 Thread Peter Zijlstra
On Thu, Apr 14, 2022 at 01:30:50PM -0700, Andrew Morton wrote: > On Thu, 14 Apr 2022 17:21:01 +0200 Peter Zijlstra > wrote: > > > > +/* The + 1 below places the pointers within the range of their array */ > > > #define for_class_range(class, _from, _to) \ > > > - for (class = (_from); class !=

RE: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-04-17 Thread David Laight
From: Peter Zijlstra > Sent: 14 April 2022 16:21 ... > > .. > > -#define sched_class_highest (__end_sched_classes - 1) > > +/* > > + * sched_class_highests is really __end_sched_classes - 1, but written in > > a way > > + * that makes it clear that it is within __begin_sched_classes[] and not

Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-04-14 Thread Andrew Morton
On Thu, 14 Apr 2022 17:21:01 +0200 Peter Zijlstra wrote: > > +/* The + 1 below places the pointers within the range of their array */ > > #define for_class_range(class, _from, _to) \ > > - for (class = (_from); class != (_to); class--) > > + for (class = (_from); class + 1 != (_to) + 1;

Re: [PATCH 1/3] sched/headers: Fix compilation error with GCC 12

2022-04-14 Thread Peter Zijlstra
On Thu, Apr 14, 2022 at 05:08:53PM +0200, Christophe de Dinechin wrote: > With gcc version 12.0.1 20220401 (Red Hat 12.0.1-0) (GCC), the following > errors are reported in sched.h when building after `make defconfig`: > Rewrite the definitions of sched_class_highest and for_class_range to >