how to ignore "X variable may be used uninitialized in this function"

smallboat smallboatca@yahoo.com
Thu Jun 24 04:50:00 GMT 2010


Thanks. But -Winit-self still does not remove this warning.

This is the warnings I included in compiling:'

 -Wall -Wbad-function-cast -Wcast-qual -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wimport -Winline -Winvalid-pch -Wlong-long -Wmain -Wmissing-braces -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wmultichar -Wnested-externs -Wnonnull -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wstrict-prototypes -Wswitch -Wswitch-default -Wswitch-enum -Wsystem-headers -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wwrite-strings -Wcast-align -Wno-pointer-sign -Wunused 

--- On Wed, 6/23/10, Tiago Maluta <tiago.maluta@gmail.com> wrote:

> From: Tiago Maluta <tiago.maluta@gmail.com>
> Subject: Re: how to ignore "X variable may be used uninitialized in this  function"
> To: "smallboatca@yahoo.com" <smallboatca@yahoo.com>
> Cc: gcc-help@gcc.gnu.org
> Date: Wednesday, June 23, 2010, 9:30 PM
> On Thu, Jun 24, 2010 at 12:59 AM, smallboatca@yahoo.com
> <smallboatca@yahoo.com>
> wrote:
> >
> > Hi,
> >
> > I got this "cond" may be used uninitialized in this
> function waring in
> > compiling my program.
> >
> > I used -Wuninitialized to ignore this warning, but it
> does not work.
> > Do you know which option (-W????) is for this  "X
> variable may be used
> > uninitialized in this function"? Thanks
> >
> 
> If you want _ignore_ this warning just omit -Winit-self
> 
> --tm
> 





More information about the Gcc-help mailing list