diff mbox

[FFmpeg-devel] configure: Add -Wno-main

Message ID CAB0OVGoOr=5oaZKeLV227T8nbHBEBhiT5nkKykoz0=M39p-CzA@mail.gmail.com
State Superseded
Headers show

Commit Message

Carl Eugen Hoyos Sept. 18, 2017, 1:37 a.m. UTC
Hi!

Attached patch fixes several warnings when compiling libavfilter with
current gcc.

Please comment, Carl Eugen

Comments

James Almer Sept. 18, 2017, 1:47 a.m. UTC | #1
On 9/17/2017 10:37 PM, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes several warnings when compiling libavfilter with
> current gcc.
> 
> Please comment, Carl Eugen

IMO, it would be better if we instead rename all the cases of "main"
used across the codebase.
I'm surprised for that matter that SDL, with its "-Dmain=SDL_main"
cflag, didn't make a mess out of this.
Carl Eugen Hoyos Sept. 18, 2017, 1:55 a.m. UTC | #2
2017-09-18 3:47 GMT+02:00 James Almer <jamrial@gmail.com>:
> On 9/17/2017 10:37 PM, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch fixes several warnings when compiling libavfilter with
>> current gcc.
>>
>> Please comment, Carl Eugen
>
> IMO, it would be better if we instead rename all the cases of "main"
> used across the codebase.

No strong opinion here, I would prefer if the warning were silenced.

Carl Eugen
Clément Bœsch Sept. 18, 2017, 5:54 a.m. UTC | #3
On Mon, Sep 18, 2017 at 03:55:12AM +0200, Carl Eugen Hoyos wrote:
> 2017-09-18 3:47 GMT+02:00 James Almer <jamrial@gmail.com>:
> > On 9/17/2017 10:37 PM, Carl Eugen Hoyos wrote:
> >> Hi!
> >>
> >> Attached patch fixes several warnings when compiling libavfilter with
> >> current gcc.
> >>
> >> Please comment, Carl Eugen
> >
> > IMO, it would be better if we instead rename all the cases of "main"
> > used across the codebase.
> 
> No strong opinion here, I would prefer if the warning were silenced.
> 

I'm with James on this one, it's easy and harmless to fix, so I think
we should do that instead.
Carl Eugen Hoyos Sept. 18, 2017, 2:33 p.m. UTC | #4
2017-09-18 7:54 GMT+02:00 Clément Bœsch <u@pkh.me>:
> On Mon, Sep 18, 2017 at 03:55:12AM +0200, Carl Eugen Hoyos wrote:
>> 2017-09-18 3:47 GMT+02:00 James Almer <jamrial@gmail.com>:
>> > On 9/17/2017 10:37 PM, Carl Eugen Hoyos wrote:
>> >> Hi!
>> >>
>> >> Attached patch fixes several warnings when compiling libavfilter with
>> >> current gcc.
>> >>
>> >> Please comment, Carl Eugen
>> >
>> > IMO, it would be better if we instead rename all the cases of "main"
>> > used across the codebase.
>>
>> No strong opinion here, I would prefer if the warning were silenced.
>
> I'm with James on this one, it's easy and harmless to fix, so I think
> we should do that instead.

Sorry for being unclear:
I would just like to silence the warnings currently shown when
compiling FFmpeg, I do not care how they are silenced, I
made a suggestion that I thought would have less impact and
less discussion. ("Where in the specification is it written that
a variable must not be called 'main'?")

Sorry, Carl Eugen
Nicolas George Sept. 18, 2017, 3:07 p.m. UTC | #5
Le jour du Génie, an CCXXV, Clement Boesch a écrit :
> I'm with James on this one, it's easy and harmless to fix, so I think
> we should do that instead.

I am also for changing the variable names. But it should also be
reported to gcc, because this warning is utterly braindead for local
symbols.

Regards,
Carl Eugen Hoyos Oct. 7, 2017, 1:45 a.m. UTC | #6
2017-09-18 3:37 GMT+02:00 Carl Eugen Hoyos <ceffmpeg@gmail.com>:
> Hi!
>
> Attached patch fixes several warnings when compiling libavfilter with
> current gcc.

Ping.

Should the warnings just stay?

Thank you, Carl Eugen
James Almer Oct. 7, 2017, 2:27 a.m. UTC | #7
On 10/6/2017 10:45 PM, Carl Eugen Hoyos wrote:
> 2017-09-18 3:37 GMT+02:00 Carl Eugen Hoyos <ceffmpeg@gmail.com>:
>> Hi!
>>
>> Attached patch fixes several warnings when compiling libavfilter with
>> current gcc.
> 
> Ping.
> 
> Should the warnings just stay?
> 
> Thank you, Carl Eugen

I'll change the name of the variables as mentioned elsewhere in the
thread. What name should i use, though? I see

AVFrame *main, *ref;

and

AVFrame *main, *second, *out;

In all four filters raising the warning.
diff mbox

Patch

From 2d2893e8f7406043f970ae347509c39832c97b50 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Mon, 18 Sep 2017 03:35:37 +0200
Subject: [PATCH] configure: Add -Wno-main.

Silences several warnings:
main is usually a function
---
 configure |    1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 2de20a0..952cb16 100755
--- a/configure
+++ b/configure
@@ -6248,6 +6248,7 @@  check_cflags -Wmissing-prototypes
 check_cflags -Wno-pointer-to-int-cast
 check_cflags -Wstrict-prototypes
 check_cflags -Wempty-body
+check_cflags -Wno-main
 
 if enabled extra_warnings; then
     check_cflags -Wcast-qual
-- 
1.7.10.4