On Jul 7, 12:37 pm, Michael DOUBEZ <michael.dou...@free.fr> wrote:
> ashnin a écrit :
>
> > Hi,
>
> > Can anyone tell me, why am I getting this warning?
>
> > cc1plus: warning: command line option "-Wdeclaration-after-statement"
> > is valid for C/ObjC but not for C++
>
> > (Actually Im compiling a set of C & C++ files from the same source
> > dir. )
>
> > What should be done to avoid this warning?
>
> You should simply remove it from your build system unless you want the
> old C declaration system that required variables to be declared at the
> beginning of a block.
>
> In all cases, you should remove it from the rule processing c++ files.
>
> Looking into the man of gcc:
> <<<
> C-only Warning Options
> [...] -Wdeclaration-after-statement [...]
>
> -Wdeclaration-after-statement (C only)
> Warn when a declaration is found after a statement in a block. This
> construct, known from C ++ , was introduced with ISO C99 and is by
> default allowed in GCC . It is not supported by ISO C90 and was not
> supported by GCC versions before GCC 3.0.
> >>>
>
> --
> Michael
Thanks. But I never included this option in command line. Then how
come it is throwing this warning?
Please tell me how to remove it from my build system.
Regards
ashnin
|