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

Umang Jain umang.jain at ideasonboard.com
Wed Jun 9 05:22:47 CEST 2021


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 at ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>
Tested-by: Umang Jain <umang.jain at 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 {
>   


More information about the libcamera-devel mailing list