diff mbox series

[FFmpeg-devel] lavc/tiff: Fix build failure due to always_inline

Message ID 20210329195710.6807-1-pkoshevoy@gmail.com
State New
Headers show
Series [FFmpeg-devel] lavc/tiff: Fix build failure due to always_inline
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Pavel Koshevoy March 29, 2021, 7:57 p.m. UTC
Fixes:
src/libavcodec/tiff.c: In function ‘tiff_unpack_strip’:
src/libavcodec/tiff.c:280: error: ‘always_inline’ function could not be inlined in call to ‘dng_blit’: the function body must appear before caller
src/libavcodec/tiff.c:720: error: called from here
---
 libavcodec/tiff.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Andreas Rheinhardt March 30, 2021, 8:26 a.m. UTC | #1
Pavel Koshevoy:
> Fixes:
> src/libavcodec/tiff.c: In function ‘tiff_unpack_strip’:
> src/libavcodec/tiff.c:280: error: ‘always_inline’ function could not be inlined in call to ‘dng_blit’: the function body must appear before caller
> src/libavcodec/tiff.c:720: error: called from here
> ---
>  libavcodec/tiff.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> index 0878098b90..4ef685b929 100644
> --- a/libavcodec/tiff.c
> +++ b/libavcodec/tiff.c
> @@ -275,9 +275,9 @@ static int add_metadata(int count, int type,
>      };
>  }
>  
> -static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stride,
> -                                      const uint8_t *src, int src_stride, int width, int height,
> -                                      int is_single_comp, int is_u16);
> +static void dng_blit(TiffContext *s, uint8_t *dst, int dst_stride,
> +                     const uint8_t *src, int src_stride, int width, int height,
> +                     int is_single_comp, int is_u16);
>  
>  static void av_always_inline horizontal_fill(TiffContext *s,
>                                               unsigned int bpp, uint8_t* dst,
> 
There are no cyclic calls here, so one can just remove the forward
declaration. I did this here:
https://ffmpeg.org/pipermail/ffmpeg-devel/2021-March/278386.html Do you
like it? And what compiler exhibits the problems you mention in the
commit message?

- Andreas
Pavel Koshevoy March 30, 2021, 3:07 p.m. UTC | #2
On Tue, Mar 30, 2021 at 2:26 AM Andreas Rheinhardt <
andreas.rheinhardt@outlook.com> wrote:

> Pavel Koshevoy:
> > Fixes:
> > src/libavcodec/tiff.c: In function ‘tiff_unpack_strip’:
> > src/libavcodec/tiff.c:280: error: ‘always_inline’ function could not be
> inlined in call to ‘dng_blit’: the function body must appear before caller
> > src/libavcodec/tiff.c:720: error: called from here
> > ---
> >  libavcodec/tiff.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> > index 0878098b90..4ef685b929 100644
> > --- a/libavcodec/tiff.c
> > +++ b/libavcodec/tiff.c
> > @@ -275,9 +275,9 @@ static int add_metadata(int count, int type,
> >      };
> >  }
> >
> > -static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int
> dst_stride,
> > -                                      const uint8_t *src, int
> src_stride, int width, int height,
> > -                                      int is_single_comp, int is_u16);
> > +static void dng_blit(TiffContext *s, uint8_t *dst, int dst_stride,
> > +                     const uint8_t *src, int src_stride, int width, int
> height,
> > +                     int is_single_comp, int is_u16);
> >
> >  static void av_always_inline horizontal_fill(TiffContext *s,
> >                                               unsigned int bpp, uint8_t*
> dst,
> >
> There are no cyclic calls here, so one can just remove the forward
> declaration. I did this here:
> https://ffmpeg.org/pipermail/ffmpeg-devel/2021-March/278386.html Do you
> like it? And what compiler exhibits the problems you mention in the
> commit message?
>
>
I wasn't sure about declaring a function more than a couple lines long as
inline.

The compiler that issued the error was apples gcc 4.2.1 on OS X 10.6

Thank you,
    Pavel.
diff mbox series

Patch

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 0878098b90..4ef685b929 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -275,9 +275,9 @@  static int add_metadata(int count, int type,
     };
 }
 
-static void av_always_inline dng_blit(TiffContext *s, uint8_t *dst, int dst_stride,
-                                      const uint8_t *src, int src_stride, int width, int height,
-                                      int is_single_comp, int is_u16);
+static void dng_blit(TiffContext *s, uint8_t *dst, int dst_stride,
+                     const uint8_t *src, int src_stride, int width, int height,
+                     int is_single_comp, int is_u16);
 
 static void av_always_inline horizontal_fill(TiffContext *s,
                                              unsigned int bpp, uint8_t* dst,