[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [linrad] Compilation error
- Subject: RE: [linrad] Compilation error
- From: Leif Åsbrink <leif.asbrink@xxxxxxxxxxxxxxxxxxxx
- Date: Wed, 28 Jan 2004 00:49:08 +0100
Hi Matthieu and all,
The compiler option -Wshadow creates an error that
becomes fatal when -Werror is also specified.
The header files of Linux and gcc change between versions
and the vgatest program was just recently included.
Some Linux versions have a variable expl and with the
above compiler options a user program can not use this name.
In Linrad-01.12 which will be uploaded as soon as I know
how to prevent Linrad from being swapped to disk (or know
it can not be done) the expl variable is renamed to xxpl.
It is ok on my system. Hopefully it will be on all other
gcc/Linux versions too.
The compiler options are for safety. It is easy to
create difficult bugs when a block of code is moved to
it's own subroutine. A local variable that shadows a global
one might become undeclared in the new subroutine and
the compiler will happily use the global variable which
will typically be fine for a while..........
73
Leif / SM5BSZ
> When compiling linrad v10-11 I get this error message:
>
> gcc -O -W -Wimplicit -Wreturn-type -Wformat \
> -Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized \
> -Wparentheses -Wstrict-prototypes -Werror -ffast-math -fforce-mem \
> -fomit-frame-pointer -c -o vgatest.o \
> vgatest.c
> vgatest.c: In function `main':
> vgatest.c:176: warning: declaration of `expl' shadows a global declaration
> <built-in>:0: warning: shadowed declaration is here
> make: *** [vgatest.o] Erreur 1
>
> Thanks your help!
>
> 73
> Matthieu
> F4BUC
>
>
LINRADDARNIL