Re: [PATCH 2/3] misc/wscript: Specify C language version
On Wed, Mar 31, 2021 at 10:44 AM Joel Sherrill wrote: > > > > On Wed, Mar 31, 2021 at 9:56 AM Gedare Bloom wrote: >> >> Should we set the cstd version at the top-level? > > > That's not what was done for C++ when I looked for examples. I suppose this > lets the C++ version vary by tool or library. And we did import some > third-party > code. > ok, not a big deal to me, just thinking that setting a baseline (especially for C) makes sense. > --joel > >> >> >> On Tue, Mar 30, 2021 at 3:16 PM Joel Sherrill wrote: >> > >> > CentOS 7 has gcc 4.8 which defaults to C90 and this results in warnings >> > for code that is valid C99 but not C90. >> > --- >> > misc/wscript | 3 ++- >> > 1 file changed, 2 insertions(+), 1 deletion(-) >> > >> > diff --git a/misc/wscript b/misc/wscript >> > index 521eddf..21e7f75 100644 >> > --- a/misc/wscript >> > +++ b/misc/wscript >> > @@ -51,7 +51,8 @@ def build(bld): >> > # >> > conf['warningflags'] = ['-Wall', '-Wextra', '-pedantic'] >> > conf['optflags'] = bld.env.C_OPTS >> > -conf['cflags'] = ['-pipe', '-g'] + conf['optflags'] >> > +cstd = '-std=c99' >> > +conf['cflags'] = [cstd] + ['-pipe', '-g'] + conf['optflags'] >> > conf['linkflags'] = ['-g'] >> > >> > # >> > -- >> > 1.8.3.1 >> > >> > ___ >> > devel mailing list >> > devel@rtems.org >> > http://lists.rtems.org/mailman/listinfo/devel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 2/3] misc/wscript: Specify C language version
On Wed, Mar 31, 2021 at 9:56 AM Gedare Bloom wrote: > Should we set the cstd version at the top-level? > That's not what was done for C++ when I looked for examples. I suppose this lets the C++ version vary by tool or library. And we did import some third-party code. --joel > > On Tue, Mar 30, 2021 at 3:16 PM Joel Sherrill wrote: > > > > CentOS 7 has gcc 4.8 which defaults to C90 and this results in warnings > > for code that is valid C99 but not C90. > > --- > > misc/wscript | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/misc/wscript b/misc/wscript > > index 521eddf..21e7f75 100644 > > --- a/misc/wscript > > +++ b/misc/wscript > > @@ -51,7 +51,8 @@ def build(bld): > > # > > conf['warningflags'] = ['-Wall', '-Wextra', '-pedantic'] > > conf['optflags'] = bld.env.C_OPTS > > -conf['cflags'] = ['-pipe', '-g'] + conf['optflags'] > > +cstd = '-std=c99' > > +conf['cflags'] = [cstd] + ['-pipe', '-g'] + conf['optflags'] > > conf['linkflags'] = ['-g'] > > > > # > > -- > > 1.8.3.1 > > > > ___ > > devel mailing list > > devel@rtems.org > > http://lists.rtems.org/mailman/listinfo/devel > ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH 2/3] misc/wscript: Specify C language version
Should we set the cstd version at the top-level? On Tue, Mar 30, 2021 at 3:16 PM Joel Sherrill wrote: > > CentOS 7 has gcc 4.8 which defaults to C90 and this results in warnings > for code that is valid C99 but not C90. > --- > misc/wscript | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/misc/wscript b/misc/wscript > index 521eddf..21e7f75 100644 > --- a/misc/wscript > +++ b/misc/wscript > @@ -51,7 +51,8 @@ def build(bld): > # > conf['warningflags'] = ['-Wall', '-Wextra', '-pedantic'] > conf['optflags'] = bld.env.C_OPTS > -conf['cflags'] = ['-pipe', '-g'] + conf['optflags'] > +cstd = '-std=c99' > +conf['cflags'] = [cstd] + ['-pipe', '-g'] + conf['optflags'] > conf['linkflags'] = ['-g'] > > # > -- > 1.8.3.1 > > ___ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel