Re: [Mesa-dev] [PATCH mesa] meson: merge C and C++ compiler arguments check
On Thursday, 2018-03-22 11:17:55 -0700, Dylan Baker wrote: > Quoting Eric Engestrom (2018-03-22 05:08:55) > > On Monday, 2018-03-12 10:16:33 -0700, Dylan Baker wrote: > > > Quoting Emil Velikov (2018-03-12 09:09:50) > > > > On 12 March 2018 at 15:01, Eric Engestrom> > > > wrote: > > > > > Signed-off-by: Eric Engestrom > > > > > --- > > > > > Dylan, was there any reason to have -Werror=missing-prototypes and > > > > > -Werror=implicit-function-declaration in C but not C++? > > > > > Both sound to me like something we always want. > > > > > > > > Seems to be copied from the autotools setup. > > > > Reason being, both are not valid for C++. > > > > Although since we probe for them, everything should be fine. The C++ > > > > test will bail out and the flags won't be set during the actual build. > > > > > > Which is why I left them separate, since it avoids having to compile for > > > arguments we know that C++ doesn't support. > > > > Pushed now (cb2ddcefa5196fdfeff7), but to explain, my point was: we want > > those warnings when possible, so we might as well test for them and use > > them if/when support is added in the compilers. > > > > The configure-time cost is very low, and the build-time cost is > > non-existent :) > > > > > It probably doesn't matter either way, > > > > > > Reviewed-by: Dylan Baker > > I didn't notice before, but this breaks compiling basically all of our C++ > code > with clang since it adds -Werror=missing-prototypes, and clang gets very angry > at us. Ah crap :( Are you pushing a revert, or should I? Question though, why is the code full of missing prototypes? Is that a compiler mistake (false-positives), or is the code really missing a bunch of includes? > > Dylan ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH mesa] meson: merge C and C++ compiler arguments check
Quoting Eric Engestrom (2018-03-22 05:08:55) > On Monday, 2018-03-12 10:16:33 -0700, Dylan Baker wrote: > > Quoting Emil Velikov (2018-03-12 09:09:50) > > > On 12 March 2018 at 15:01, Eric Engestrom> > > wrote: > > > > Signed-off-by: Eric Engestrom > > > > --- > > > > Dylan, was there any reason to have -Werror=missing-prototypes and > > > > -Werror=implicit-function-declaration in C but not C++? > > > > Both sound to me like something we always want. > > > > > > Seems to be copied from the autotools setup. > > > Reason being, both are not valid for C++. > > > Although since we probe for them, everything should be fine. The C++ > > > test will bail out and the flags won't be set during the actual build. > > > > Which is why I left them separate, since it avoids having to compile for > > arguments we know that C++ doesn't support. > > Pushed now (cb2ddcefa5196fdfeff7), but to explain, my point was: we want > those warnings when possible, so we might as well test for them and use > them if/when support is added in the compilers. > > The configure-time cost is very low, and the build-time cost is > non-existent :) > > > It probably doesn't matter either way, > > > > Reviewed-by: Dylan Baker I didn't notice before, but this breaks compiling basically all of our C++ code with clang since it adds -Werror=missing-prototypes, and clang gets very angry at us. Dylan signature.asc Description: signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH mesa] meson: merge C and C++ compiler arguments check
On Monday, 2018-03-12 10:16:33 -0700, Dylan Baker wrote: > Quoting Emil Velikov (2018-03-12 09:09:50) > > On 12 March 2018 at 15:01, Eric Engestromwrote: > > > Signed-off-by: Eric Engestrom > > > --- > > > Dylan, was there any reason to have -Werror=missing-prototypes and > > > -Werror=implicit-function-declaration in C but not C++? > > > Both sound to me like something we always want. > > > > Seems to be copied from the autotools setup. > > Reason being, both are not valid for C++. > > Although since we probe for them, everything should be fine. The C++ > > test will bail out and the flags won't be set during the actual build. > > Which is why I left them separate, since it avoids having to compile for > arguments we know that C++ doesn't support. Pushed now (cb2ddcefa5196fdfeff7), but to explain, my point was: we want those warnings when possible, so we might as well test for them and use them if/when support is added in the compilers. The configure-time cost is very low, and the build-time cost is non-existent :) > It probably doesn't matter either way, > > Reviewed-by: Dylan Baker ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH mesa] meson: merge C and C++ compiler arguments check
Quoting Emil Velikov (2018-03-12 09:09:50) > On 12 March 2018 at 15:01, Eric Engestromwrote: > > Signed-off-by: Eric Engestrom > > --- > > Dylan, was there any reason to have -Werror=missing-prototypes and > > -Werror=implicit-function-declaration in C but not C++? > > Both sound to me like something we always want. > > Seems to be copied from the autotools setup. > Reason being, both are not valid for C++. > Although since we probe for them, everything should be fine. The C++ > test will bail out and the flags won't be set during the actual build. Which is why I left them separate, since it avoids having to compile for arguments we know that C++ doesn't support. It probably doesn't matter either way, Reviewed-by: Dylan Baker signature.asc Description: signature ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH mesa] meson: merge C and C++ compiler arguments check
On 12 March 2018 at 15:01, Eric Engestromwrote: > Signed-off-by: Eric Engestrom > --- > Dylan, was there any reason to have -Werror=missing-prototypes and > -Werror=implicit-function-declaration in C but not C++? > Both sound to me like something we always want. Seems to be copied from the autotools setup. Reason being, both are not valid for C++. Although since we probe for them, everything should be fine. The C++ test will bail out and the flags won't be set during the actual build. Reviewed-by: Emil Velikov -Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH mesa] meson: merge C and C++ compiler arguments check
Signed-off-by: Eric Engestrom--- Dylan, was there any reason to have -Werror=missing-prototypes and -Werror=implicit-function-declaration in C but not C++? Both sound to me like something we always want. --- meson.build | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/meson.build b/meson.build index b9f7cd2aff5fc49e0d93..6a4d2aded7c72bbb1029 100644 --- a/meson.build +++ b/meson.build @@ -766,7 +766,9 @@ if ['linux', 'cygwin'].contains(host_machine.system()) pre_args += '-D_GNU_SOURCE' endif -# Check for generic C arguments +# Check for generic C/C++ arguments +cpp = meson.get_compiler('cpp') +cpp_args = [] c_args = [] foreach a : ['-Wall', '-Werror=implicit-function-declaration', '-Werror=missing-prototypes', '-fno-math-errno', @@ -774,22 +776,15 @@ foreach a : ['-Wall', '-Werror=implicit-function-declaration', if cc.has_argument(a) c_args += a endif + if cpp.has_argument(a) +cpp_args += a + endif endforeach c_vis_args = [] if cc.has_argument('-fvisibility=hidden') c_vis_args += '-fvisibility=hidden' endif -# Check for generic C++ arguments -cpp = meson.get_compiler('cpp') -cpp_args = [] -foreach a : ['-Wall', '-fno-math-errno', '-fno-trapping-math', - '-Qunused-arguments'] - if cpp.has_argument(a) -cpp_args += a - endif -endforeach - # For some reason, the test for -Wno-foo always succeeds with gcc, even if the # option is not supported. Hence, check for -Wfoo instead. if cpp.has_argument('-Wnon-virtual-dtor') -- Cheers, Eric ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev