[FFmpeg-devel] [PATCH] fftools/ffmpeg: Fix declaration-after-statement warning

Nicolas George george at nsup.org
Mon Jul 19 12:40:09 EEST 2021


Andreas Rheinhardt (12021-07-18):
> I pushed this to fix the warning, although I'd like to hear other
> peoples' opinion on whether the warning should no longer be enabled.

I personally consider it is good code hygiene to group variable
declarations.

It reduces diff noise when we need to use the same variable earlier. It
makes it easier to spot if we already have the variable we need or if we
are about to redeclare one.

I have used languages where variables could not be declared earlier, I
still use languages where declaring is nor idiomatic at all, I have
tried writing C with on-the-spot declarations and came back from it. It
really makes the code harder to maintain.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210719/ff2d22d5/attachment.sig>


More information about the ffmpeg-devel mailing list