Re: make fails to build on linux

2021-04-17 Thread Manuel Bouyer
On Sat, Apr 17, 2021 at 10:44:36PM +0200, Jaromír Dole?ek wrote:
> Le sam. 17 avr. 2021 à 19:49, Manuel Bouyer  a écrit :
> >
> > On Sat, Apr 17, 2021 at 07:25:58PM +0200, Manuel Bouyer wrote:
> > > Hello
> > > trying a build.sh tools on linux I got:
> > > /dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:
> > > In function '__regex_wctype':
> > > /dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:254:2:
> > >  error: 'for' loop initial declarations are only allowed in C99 mode
> > >   for (size_t i = 0; i < __arraycount(wctypes); i++) {
> > > ^
> > > /dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:2
> > > 54:2: note: use option -std=c99 or -std=gnu99 to compile your code
> > >
> > > What is the right fix for this ?
> > >
> > > For now I just moved the declaration outside of the loop
> >
> > Well, the build fails later with the same error.
> > Using "-V HOST_CFLAGS=-std=gnu99" allows the tools to build; maybe
> > this should be the default ?
> 
> I think it would be sensible to use -std=c99 by default, yes. It's

it has to be gnu99; I tried c99 and it failed with some types not defined.

> strange that the Linux toolchain refuses it by default, do we force
> some other -std flag by default now by chance?

AFAIK no. But the toolchain on RLEL7 is quite old: 
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


Re: make fails to build on linux

2021-04-17 Thread Jaromír Doleček
Le sam. 17 avr. 2021 à 19:49, Manuel Bouyer  a écrit :
>
> On Sat, Apr 17, 2021 at 07:25:58PM +0200, Manuel Bouyer wrote:
> > Hello
> > trying a build.sh tools on linux I got:
> > /dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:
> > In function '__regex_wctype':
> > /dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:254:2:
> >  error: 'for' loop initial declarations are only allowed in C99 mode
> >   for (size_t i = 0; i < __arraycount(wctypes); i++) {
> > ^
> > /dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:2
> > 54:2: note: use option -std=c99 or -std=gnu99 to compile your code
> >
> > What is the right fix for this ?
> >
> > For now I just moved the declaration outside of the loop
>
> Well, the build fails later with the same error.
> Using "-V HOST_CFLAGS=-std=gnu99" allows the tools to build; maybe
> this should be the default ?

I think it would be sensible to use -std=c99 by default, yes. It's
strange that the Linux toolchain refuses it by default, do we force
some other -std flag by default now by chance?

Jaromir


Re: make fails to build on linux

2021-04-17 Thread Manuel Bouyer
On Sat, Apr 17, 2021 at 10:54:48AM -0700, Jason Thorpe wrote:
> 
> > On Apr 17, 2021, at 10:48 AM, Manuel Bouyer  wrote:
> > 
> > Well, the build fails later with the same error.
> > Using "-V HOST_CFLAGS=-std=gnu99" allows the tools to build; maybe
> > this should be the default ?
> 
> Just fix the code to not use that style of declaration?

Some of them are in imported code (gnu toolchain); this is why I didn't
try to fix it

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


Re: make fails to build on linux

2021-04-17 Thread Jason Thorpe


> On Apr 17, 2021, at 10:48 AM, Manuel Bouyer  wrote:
> 
> Well, the build fails later with the same error.
> Using "-V HOST_CFLAGS=-std=gnu99" allows the tools to build; maybe
> this should be the default ?

Just fix the code to not use that style of declaration?

-- thorpej



Re: make fails to build on linux

2021-04-17 Thread Manuel Bouyer
On Sat, Apr 17, 2021 at 07:25:58PM +0200, Manuel Bouyer wrote:
> Hello
> trying a build.sh tools on linux I got:
> /dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:
>  
> In function '__regex_wctype':
> /dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:254:2:
>  error: 'for' loop initial declarations are only allowed in C99 mode
>   for (size_t i = 0; i < __arraycount(wctypes); i++) {
> ^
> /dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:2
> 54:2: note: use option -std=c99 or -std=gnu99 to compile your code
> 
> What is the right fix for this ?
> 
> For now I just moved the declaration outside of the loop

Well, the build fails later with the same error.
Using "-V HOST_CFLAGS=-std=gnu99" allows the tools to build; maybe
this should be the default ?

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--


make fails to build on linux

2021-04-17 Thread Manuel Bouyer
Hello
trying a build.sh tools on linux I got:
/dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c: 
In function '__regex_wctype':
/dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:254:2:
 error: 'for' loop initial declarations are only allowed in C99 mode
  for (size_t i = 0; i < __arraycount(wctypes); i++) {
^
/dsk/l1/misc/bouyer/HEAD/clean/src/tools/compat/../../lib/libc/regex/regcomp.c:2
54:2: note: use option -std=c99 or -std=gnu99 to compile your code

What is the right fix for this ?

For now I just moved the declaration outside of the loop

-- 
Manuel Bouyer 
 NetBSD: 26 ans d'experience feront toujours la difference
--