[Ffmpeg-devel] [PATCH] -Wdeclaration-after-statement

Michel Bardiaux mbardiaux
Tue Jan 3 15:38:31 CET 2006


Diego Biurrun wrote:
> On Tue, Jan 03, 2006 at 02:24:23PM +0100, Michel Bardiaux wrote:
> 
>>>On Thu, Dec 22, 2005 at 01:17:52PM -0500, Rich Felker wrote:
>>>
>>>
>>>>>On Thu, Dec 22, 2005 at 07:05:17AM -0500, Dave Dodge wrote:
>>>>
>>>>>>>On Thu, Dec 22, 2005 at 12:17:01PM +0100, Michel Bardiaux
>>>>>>>wrote:
>>>>>
>>>>>>>>>Is there a switch to force a warning or error on the use
>>>>>>>>>of the *evil* (IMNSHO) C9xism of
>>>>>>>>>declarations-mixed-with-execution?
>>>>>>>
>>>>>>>-Wdeclaration-after-statement
>>>>>>>
>>>>>>>Just tried it in gcc 3.4.2 and it seems to do what you want
>>>>>>>even when -std=c99 is enabled.
>>>>>
>>>>>Yes they finally added this after realizing that it's bad style,
>>>>>but there are plenty older gcc versions without it. Could we
>>>>>enable it by default for gcc versions that support it so people
>>>>>would stop committing code like this?
>>>
>>>sure, as soon as someone posts a patch / cvs commits ...
>>
>>Here it is - tested against gcc up to 3.3.5, none of which *has* the 
>>option. Could someone who has gcc 3.4.2 try it?
> 
> 
> Works for me with gcc 4.0.3, applied.

Goody goody!

> 
>>What about other paranoid options, like -std=c99 -pedantic -Wall -Wextra 
>>-Werror ?
> 
> 
> -Wall is already in CFLAGS.
> 
> Diego
> 
Of course. And these are actually 2 very different issues:

(1) -Werror to prevent people committing code causing warnings

(2) Additional warnings using -std=c99 -pedantic -Wextra

-pedantic warns about 'inline' and 'asm' so I guess this excludes it 
straightaway!

-std=c99 -Wextra both missing in 2.95, so I cant try them.


-- 
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:mbardiaux at mediaxim.be

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/





More information about the ffmpeg-devel mailing list