[Swfdec] [PATCH] fix issues from latest commits

Riccardo Magliocchetti riccardo.magliocchetti at gmail.com
Sun Jun 8 08:48:48 PDT 2008


Benjamin Otte wrote:
> Which gcc version are you using? The one I'm using does not have this
> problem. Also, does anybody else have this problem?

rm at eurasia:~$ gcc -v
Reading specs from /usr/lib/gcc/i486-linux-gnu/3.4.6/specs
Configured with: ../src/configure -v --enable-languages=c --prefix=/usr
--libexecdir=/usr/lib --with-gxx-include-dir=/usr/include/c++/3.4
--enable-shared --with-system-zlib --enable-nls
--without-included-gettext --program-suffix=-3.4 --enable-__cxa_atexit
--with-tune=i686 i486-linux-gnu
Thread model: posix
gcc version 3.4.6 (Debian 3.4.6-7)

BTW gcc version 4.1.3 20080420 (prerelease) (Debian 4.1.2-22) works fine.

> For me, the following program does not cause a warning:
> void foo (void);
> void bar (int foo);
> 
> while this one causes a warning:
> void foo (void);
> void bar (int foo) {}

I confirm that both cause a warning there:

rm at eurasia:~$ gcc -Wshadow -o shadow shadow.c
shadow.c:2: warning: declaration of 'foo' shadows a global declaration
shadow.c:1: warning: shadowed declaration is here
rm at eurasia:~$ cat shadow.c
void foo (void);
void bar (int foo);

int main() {}

rm at eurasia:~$ gcc -Wshadow -o shadow2 shadow2.c
shadow2.c:2: warning: declaration of 'foo' shadows a global declaration
shadow2.c:1: warning: shadowed declaration is here
rm at eurasia:~$ cat shadow2.c
void foo (void);
void bar (int foo) {}

int main() {}

> Which makes sense, because in the first case, it's just a prototype
> where the names don't matter while the second case is the actual
> function, where the name does matter.
> GStreamer headers however are just declarations, so they are part of
> the first case and shouldn't cause a warning.
> Which gets me back to the first problem: Why does it cause a warning for you?
> 
> I have disabled -Wshadow now, but I want to reenable this, as it has
> saved me two or three times on Swfdec already. So I'd love if somebody
> could investigate this.

Is possible to define it only on GCC version > 4?

Also -Wno-missing-field-initializers appears to not work in gcc-3.4 and 
-Wextra put that check in:

swfdec_as_context.c: In function `swfdec_as_context_run':
swfdec_as_context.c:857: warning: missing initializer
swfdec_as_context.c:857: warning: (near initialization for `rval.value')


> On Sat, Jun 7, 2008 at 12:00 PM, Riccardo Magliocchetti
> <riccardo.magliocchetti at gmail.com> wrote:
>> Riccardo Magliocchetti wrote:
>>> Still not able to compile swfdec (shadow warnings), will follow other
>>> patches if you don't beat me to it.
>> ouch, the problem is in gstreamer (0.10.19) vs time.h (clock, time) and
>> stdlib.h (free) :|
>>

cheers,
rm




More information about the Swfdec mailing list