[libcamera-devel] ipa: ipu3: Fix struct/class mismatch in forward declaration
diff mbox series

Message ID 20210608212714.9381-1-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel] ipa: ipu3: Fix struct/class mismatch in forward declaration
Related show

Commit Message

Laurent Pinchart June 8, 2021, 9:27 p.m. UTC
The ipu3_agc.h forward-declares the IPACameraSensorInfo structure, but
incorrectly declares it as a class. This causes a compilation error with
clang:

include/libcamera/ipa/core_ipa_interface.h:24:1: error: 'IPACameraSensorInfo' defined as a struct here but previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Werror,-Wmismatched-tags]
struct IPACameraSensorInfo
^
../../src/ipa/ipu3/ipu3_agc.h:21:1: note: did you mean struct here?
class IPACameraSensorInfo;
^~~~~
struct

Fix it.

Fixes: 384a53d3cdf7 ("ipa: ipu3: Calculate line duration from IPACameraSensorInfo")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/ipa/ipu3/ipu3_agc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Elder June 9, 2021, 2:26 a.m. UTC | #1
Hi Laurent,

On Wed, Jun 09, 2021 at 12:27:14AM +0300, Laurent Pinchart wrote:
> The ipu3_agc.h forward-declares the IPACameraSensorInfo structure, but
> incorrectly declares it as a class. This causes a compilation error with
> clang:
> 
> include/libcamera/ipa/core_ipa_interface.h:24:1: error: 'IPACameraSensorInfo' defined as a struct here but previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Werror,-Wmismatched-tags]
> struct IPACameraSensorInfo
> ^
> ../../src/ipa/ipu3/ipu3_agc.h:21:1: note: did you mean struct here?
> class IPACameraSensorInfo;
> ^~~~~
> struct
> 
> Fix it.
> 
> Fixes: 384a53d3cdf7 ("ipa: ipu3: Calculate line duration from IPACameraSensorInfo")
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/ipa/ipu3/ipu3_agc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/ipu3/ipu3_agc.h b/src/ipa/ipu3/ipu3_agc.h
> index 99a582a9fdcf..f3d4055761e6 100644
> --- a/src/ipa/ipu3/ipu3_agc.h
> +++ b/src/ipa/ipu3/ipu3_agc.h
> @@ -18,7 +18,7 @@
>  
>  namespace libcamera {
>  
> -class IPACameraSensorInfo;
> +struct IPACameraSensorInfo;
>  
>  namespace ipa::ipu3 {
>  
> -- 
> Regards,
> 
> Laurent Pinchart
>
Hirokazu Honda June 9, 2021, 3:22 a.m. UTC | #2
Hi Laurent, thank you for the patch.

On Wed, Jun 9, 2021 at 11:26 AM <paul.elder@ideasonboard.com> wrote:

> Hi Laurent,
>
> On Wed, Jun 09, 2021 at 12:27:14AM +0300, Laurent Pinchart wrote:
> > The ipu3_agc.h forward-declares the IPACameraSensorInfo structure, but
> > incorrectly declares it as a class. This causes a compilation error with
> > clang:
> >
> > include/libcamera/ipa/core_ipa_interface.h:24:1: error:
> 'IPACameraSensorInfo' defined as a struct here but previously declared as a
> class; this is valid, but may result in linker errors under the Microsoft
> C++ ABI [-Werror,-Wmismatched-tags]
> > struct IPACameraSensorInfo
> > ^
> > ../../src/ipa/ipu3/ipu3_agc.h:21:1: note: did you mean struct here?
> > class IPACameraSensorInfo;
> > ^~~~~
> > struct
> >
> > Fix it.
> >
> > Fixes: 384a53d3cdf7 ("ipa: ipu3: Calculate line duration from
> IPACameraSensorInfo")
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
>
>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>


> > ---
> >  src/ipa/ipu3/ipu3_agc.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/ipa/ipu3/ipu3_agc.h b/src/ipa/ipu3/ipu3_agc.h
> > index 99a582a9fdcf..f3d4055761e6 100644
> > --- a/src/ipa/ipu3/ipu3_agc.h
> > +++ b/src/ipa/ipu3/ipu3_agc.h
> > @@ -18,7 +18,7 @@
> >
> >  namespace libcamera {
> >
> > -class IPACameraSensorInfo;
> > +struct IPACameraSensorInfo;
> >
> >  namespace ipa::ipu3 {
> >
> > --
> > Regards,
> >
> > Laurent Pinchart
> >
>
Umang Jain June 9, 2021, 3:22 a.m. UTC | #3
Hi Laurent,

Thank you for the patch.

On 6/9/21 2:57 AM, Laurent Pinchart wrote:
> The ipu3_agc.h forward-declares the IPACameraSensorInfo structure, but
> incorrectly declares it as a class. This causes a compilation error with
> clang:
>
> include/libcamera/ipa/core_ipa_interface.h:24:1: error: 'IPACameraSensorInfo' defined as a struct here but previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Werror,-Wmismatched-tags]
> struct IPACameraSensorInfo
> ^
> ../../src/ipa/ipu3/ipu3_agc.h:21:1: note: did you mean struct here?
> class IPACameraSensorInfo;
> ^~~~~
> struct


I can reproduce this by:

$ CC=clang CXX=clang++ meson --prefix=/usr build-clang
$ ninja -C build-clang/

I was under the impression that building the patches under cros env 
(that seems to use clang), was good enough for compile test before push. 
I guess not. Apologies for the breakage.
I'll push this fix soon.

>
> Fix it.
>
> Fixes: 384a53d3cdf7 ("ipa: ipu3: Calculate line duration from IPACameraSensorInfo")
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Tested-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>   src/ipa/ipu3/ipu3_agc.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/ipa/ipu3/ipu3_agc.h b/src/ipa/ipu3/ipu3_agc.h
> index 99a582a9fdcf..f3d4055761e6 100644
> --- a/src/ipa/ipu3/ipu3_agc.h
> +++ b/src/ipa/ipu3/ipu3_agc.h
> @@ -18,7 +18,7 @@
>   
>   namespace libcamera {
>   
> -class IPACameraSensorInfo;
> +struct IPACameraSensorInfo;
>   
>   namespace ipa::ipu3 {
>

Patch
diff mbox series

diff --git a/src/ipa/ipu3/ipu3_agc.h b/src/ipa/ipu3/ipu3_agc.h
index 99a582a9fdcf..f3d4055761e6 100644
--- a/src/ipa/ipu3/ipu3_agc.h
+++ b/src/ipa/ipu3/ipu3_agc.h
@@ -18,7 +18,7 @@ 
 
 namespace libcamera {
 
-class IPACameraSensorInfo;
+struct IPACameraSensorInfo;
 
 namespace ipa::ipu3 {