[FFmpeg-devel] [PATCH] doc/developer: update style guidelines to include for loops with declarations
Clément Bœsch
u at pkh.me
Thu Nov 9 19:46:07 EET 2017
On Wed, Nov 08, 2017 at 09:26:13PM +0000, Rostislav Pehlivanov wrote:
> Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>
> ---
> doc/developer.texi | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/doc/developer.texi b/doc/developer.texi
> index a7b4f1d737..de7d887451 100644
> --- a/doc/developer.texi
> +++ b/doc/developer.texi
> @@ -132,6 +132,9 @@ designated struct initializers (@samp{struct s x = @{ .i = 17 @};});
> @item
> compound literals (@samp{x = (struct s) @{ 17, 23 @};}).
>
> + at item
> +for loops with variable definition (@samp{for (int i = 0; i < 8; i++)});
> +
I'm fine with this and would be happy to update all the code I maintain in
FFmpeg to follow this pattern. But I have a few questions/reservations:
- what does it imply for mixed statements and declarations?
If we still do not allow them, how are you going to make the compiler
reject them but not the for (int ... ) form?
Also, allowing this but not the mixed statements and declarations means
this is a style decision and not a technical one anymore.
- are we going to accept all kind of patches to change the coding style
all over the codebase?
- this require a Changelog entry as it has a technical impact (which could
be considered negligible).
Overall, I'd enjoy this change being accepted (even along mixed statements
and declarations).
[...]
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171109/1fe20866/attachment.sig>
More information about the ffmpeg-devel
mailing list