Opened 2 months ago

Closed 2 months ago

#6728 closed defect (fixed)

Inline variable declarations break builds when using non-C99 compliant compiler

Reported by: mark.mccormack Owned by:
Priority: minor Component: avcodec
Version: git-master Keywords: msvc regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Apologies if this is not the correct place to report this, it is compile related not run-time related. I am reporting it because it does appear to be an anomaly in the latest code base.

I have previously been building ffmpeg with the VS2012 compiler OK using the instructions detailed at: https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC.

However, a recent change to libavcodec/proresdec2.c contains inline variable declarations which breaks a C89-style compiler using a C89-C99 convertor.

The code in question is contained in lines 599-606.

https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/proresdec2.c#L599

I appreciate pandering to older compilers could be a burden on development, so if this is intentional then I completely understand. However, with this code removed the rest of the code-base builds OK.

Attachments (1)

patchprores2.diff (703 bytes) - added by cehoyos 2 months ago.

Download all attachments as: .zip

Change History (5)

Changed 2 months ago by cehoyos

comment:1 Changed 2 months ago by cehoyos

  • Keywords msvc regression added; compiler removed
  • Reproduced by developer unset

What does recent mean?

Please test if attached patch fixes the issue for you.

comment:2 Changed 2 months ago by mark.mccormack

"recent". Yes, poor bug reporting on my behalf. It appears that this was the change that introduced the issue.

https://github.com/FFmpeg/FFmpeg/commit/9c43703620a8b2b002cc0681f2da5cf869f0fc80

Thank you for the patch, I will test it ASAP and post the result.

comment:3 Changed 2 months ago by mark.mccormack

The patch provided solves the issue (No other changes were required to the source code to complete the build).

comment:4 Changed 2 months ago by cehoyos

  • Resolution set to fixed
  • Status changed from new to closed

Patch applied, thank you for the report and the testing.

Note: See TracTickets for help on using tickets.