Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

debugger plugin - WARNING! uninitialized variable

(1/1)

rickg22:
I was compiling today's svn, and noticed the following error:

G:\projects\codeblocks\src\plugins\debuggergdb\debuggergdb.cpp:951: warning: 'tgtIdx' might be used uninitialized in this function

The line is:
            int tgtIdx = project->SelectTarget(tgtIdx);

It worries me. The SelectTarget uses as the parameter, an initialized value. How to handle this?

MortenMacFly:

--- Quote from: rickg22 on May 25, 2007, 02:58:14 am ---            int tgtIdx = project->SelectTarget(tgtIdx);

--- End quote ---
Yay, thats a bad one. I think it should be:

--- Code: ---  int tgtIdx = project->SelectTarget();

--- End code ---
This will use the default value -1 as initial target which is good since the requested build target is not valid (see line 949). Don't know who did that, but I suspect Yiannis... :twisted: ;-)
With regards, Morten.

mandrav:

--- Quote from: MortenMacFly on May 25, 2007, 07:55:45 am ---
--- Quote from: rickg22 on May 25, 2007, 02:58:14 am ---            int tgtIdx = project->SelectTarget(tgtIdx);

--- End quote ---
Yay, thats a bad one. I think it should be:

--- Code: ---  int tgtIdx = project->SelectTarget();

--- End code ---
This will use the default value -1 as initial target which is good since the requested build target is not valid (see line 949). Don't know who did that, but I suspect Yiannis... :twisted: ;-)
With regards, Morten.

--- End quote ---

Don't suspect... be sure it was me :lol:.
Someone correct this please (sorry, my time is really limited atm).

Biplab:

--- Quote from: mandrav on May 25, 2007, 09:01:05 am ---Someone correct this please (sorry, my time is really limited atm).

--- End quote ---

Corrected. :)

rickg22:
Yay! I spotted a bug made by Yiannis!  8)

*Back in the saddle again...*  :lol:

Navigation

[0] Message Index

Go to full version