[libcamera-devel,8/8] meson: Enable -Wextra-semi for clang
diff mbox series

Message ID 20201020052905.89267-9-hiroh@chromium.org
State Accepted
Headers show
Series
  • [libcamera-devel,1/8] test: Omit extra semicolons
Related show

Commit Message

Hirokazu Honda Oct. 20, 2020, 5:29 a.m. UTC
The option, -Wxtra-semi, helps developers to find unnecessary
semicolons. This option is available with clang.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
---
 meson.build | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Laurent Pinchart Oct. 20, 2020, 7:51 a.m. UTC | #1
Hi Hiro-san,

Thank you for the patch.

On Tue, Oct 20, 2020 at 02:29:05PM +0900, Hirokazu Honda wrote:
> The option, -Wxtra-semi, helps developers to find unnecessary

s/-Wxtra-semi/-Wextra-semi/

> semicolons. This option is available with clang.
> 
> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
> ---
>  meson.build | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/meson.build b/meson.build
> index de15cc1..480c861 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -64,6 +64,12 @@ if cc.get_id() == 'clang'
>              '-stdlib=libc++',
>          ]
>      endif
> +
> +    if cc.has_argument('-Wextra-semi')
> +       cpp_arguments += [
> +           '-Wextra-semi',
> +       ]
> +    endif

The flag has been supported by clang since v4.0.0, I think we can drop
the has_arguments check. Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  endif
>  
>  if cc.get_id() == 'gcc'
Hirokazu Honda Oct. 20, 2020, 8:23 a.m. UTC | #2
On Tue, Oct 20, 2020 at 4:52 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Hiro-san,
>
> Thank you for the patch.
>
> On Tue, Oct 20, 2020 at 02:29:05PM +0900, Hirokazu Honda wrote:
> > The option, -Wxtra-semi, helps developers to find unnecessary
>
> s/-Wxtra-semi/-Wextra-semi/
>
> > semicolons. This option is available with clang.
> >
> > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
> > ---
> >  meson.build | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/meson.build b/meson.build
> > index de15cc1..480c861 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -64,6 +64,12 @@ if cc.get_id() == 'clang'
> >              '-stdlib=libc++',
> >          ]
> >      endif
> > +
> > +    if cc.has_argument('-Wextra-semi')
> > +       cpp_arguments += [
> > +           '-Wextra-semi',
> > +       ]
> > +    endif
>
> The flag has been supported by clang since v4.0.0, I think we can drop
> the has_arguments check. Apart from that,
>

Thanks, as clang 4.0.0 is released in March 2017, let's drop has_arguments.

Regards,
-Hiro
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> >  endif
> >
> >  if cc.get_id() == 'gcc'
>
> --
> Regards,
>
> Laurent Pinchart

Patch
diff mbox series

diff --git a/meson.build b/meson.build
index de15cc1..480c861 100644
--- a/meson.build
+++ b/meson.build
@@ -64,6 +64,12 @@  if cc.get_id() == 'clang'
             '-stdlib=libc++',
         ]
     endif
+
+    if cc.has_argument('-Wextra-semi')
+       cpp_arguments += [
+           '-Wextra-semi',
+       ]
+    endif
 endif
 
 if cc.get_id() == 'gcc'