Author Topic: Probably a bug!  (Read 4149 times)

Offline 198710

  • Multiple posting newcomer
  • *
  • Posts: 32
Probably a bug!
« on: October 12, 2009, 09:55:39 am »
My c++ code about stl_list is complied with warning :" '__p' might be used uninitialized in this function " under the circumstance where "codeblocks-8.02mingw-setup.exe" is installed.
However,the warnings no longer exist if I install "codeblocks-8.02-setup.exe" and MinGW separately,thus I guess it's C::B's integration problem because I even tried to replace the "MinGW" folder and "mingwm10.dll" under codeblocks program directory.
Here's my code(in the attachment)

[attachment deleted by admin]

zabzonk

  • Guest
Re: Probably a bug!
« Reply #1 on: October 12, 2009, 12:14:19 pm »
Your code is syntactically correct (though you really should be using const references as function parameters in several places). Possibly this  is a problem with the old verdion of GCC  that comes with the CB release version. If using a later version of GCC fixes the problem, as seems to be the case, I don't think you have anything to worry about.

Offline 198710

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Probably a bug!
« Reply #2 on: October 12, 2009, 04:07:57 pm »
Well,then did you notice I said "I even tried to replace the "MinGW" folder and "mingwm10.dll" under codeblocks program directory"?
I replaced the default MinGW folder and "mingwm10.dll" inside "codeblocks-8.02mingw-setup.exe" with the "correct-compile-result" MinGW folder and "mingwm10.dll",still warnings...

zabzonk

  • Guest
Re: Probably a bug!
« Reply #3 on: October 12, 2009, 05:21:09 pm »
You said:

However,the warnings no longer exist if I install "codeblocks-8.02-setup.exe" and MinGW separately,

so I'm a bit confused as to what your problem is - are you still getting warnings or not? And which version of MinGW are you installing separately?

 

Offline 198710

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Probably a bug!
« Reply #4 on: October 12, 2009, 05:52:40 pm »
On my local machine,I installed "codeblocks-8.02mingw-setup.exe";
On my Virtual PC 2007(virtual WinXP guest),I installed "codeblocks-8.02-setup.exe" and MinGW separately,and the MinGW version is "MinGW-5.1.6.exe" from http://sourceforge.net/projects/mingw/files/;
Then I deleted the folder "C:\Program Files\CodeBlocks\MinGW" on my local machine,copied "C:\MinGW"(virtual machine) to "C:\Program Files\CodeBlocks\MinGW"(local machine),and replaced "C:\Program Files\CodeBlocks\mingwm10.dll"(local machine) with "C:\MinGW\bin\mingwm10.dll"(virtual machine) as well.
Warnings never occur on the virtual machine and never disappear on the local one.

Offline koso

  • Multiple posting newcomer
  • *
  • Posts: 58
Re: Probably a bug!
« Reply #5 on: October 12, 2009, 06:35:34 pm »
Try to compare compiler settings (Settings -> Compiler and Debugger ...) in both enviroments. I think there will be differences in some optimalization flags.

zabzonk

  • Guest
Re: Probably a bug!
« Reply #6 on: October 12, 2009, 07:06:07 pm »
Warnings never occur on the virtual machine and never disappear on the local one.


So your problems are regarding virtualisation. It might have been a good idea to mention that in your original question, and I think you probably need to ask this in a forum that concerns itself with that topic.

Offline 198710

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: Probably a bug!
« Reply #7 on: October 13, 2009, 06:43:22 am »
Try to compare compiler settings (Settings -> Compiler and Debugger ...) in both enviroments. I think there will be differences in some optimalization flags.
Great Answer!
I deselected the "-O" on my local machine,the code is then compiled fine,I guess it's a problem of gcc.
But I accidently discovered a small mistake of "codeblocks-8.02mingw-setup.exe" after comparison:
In the "Toolchain executables" tab,"Make program" is set to "make.exe" by default while there's no such file in MinGW's directory,but "mingw32-make.exe" instead,like the one auto-detected on my virtual machine.