shall I tweak the mptracker warnings? C4244

Started by Leo.Robusto, October 15, 2008, 21:27:10

Previous topic - Next topic

Leo.Robusto

hello fellows,

I installed my Visual Studio 2008 Professional 90 days trial. right now.
When I compile, I get lots of warnings like:

warning C4244: '=': Konvertierung von 'int' in 'unsigned char', möglicher Datenverlust

It would be a pleasure for me to tweak the code and make it compile without warnings.

Please tell me the correct branch where I can do that!

Yours,
  Leo
The Answer is out there - "The X-Files"

bvanoudtshoorn

Good luck with that. When I compile the code, I also get a thousand and one warnings. As far as I can tell, you can safely ignore them. They're not errors, and they're not actually problems.

Saga Musix

Oh yes, there are plenty of them. I guess some conversions are missing here, but it will be a lot of work to include them all. of course it would be faster to disable certain error messages as it's already done in some cpp files. :)
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Relabsoluness

While it definitely would be a nice thing to have all the warnings removed, the fact is that there are hundreds of them, and fixing the cause for all of them is not a small and trivial task; I'm a bit doubting is it worth the trouble.

Quote from: "bvanoudtshoorn"Good luck with that. When I compile the code, I also get a thousand and one warnings. As far as I can tell, you can safely ignore them. They're not errors, and they're not actually problems.
There are already quite amount of warnings when compiling with VC2003, but the huge number of warnings generated when compiling with VC2008 is because it generates warnings when using functions like strcpy and memcpy.

Quote from: "Jojo"I guess some conversions are missing here, but it will be a lot of work to include them all.
And simply adding a cast might not be a good solution for all of the conversion warnings.

Leo.Robusto

Hello fellows,

this statement at the end of stdafx.h works well to reduce the flood of warnings to a handable amount:

// disable warning of deprecated functions like strncpy() etc.
#pragma warning(disable : 4996)  


I started with the svn tree:
openmpt\trunk\openmpt\...

please tell me, if that is not the actual branch!!!

Yours,
   Leo
The Answer is out there - "The X-Files"

Leo.Robusto

Hello fellows,

I promosed to get involved into coding...

As a first step to get used to the code,
I want to tweak the compiler warnings,
which are mostly convertion problems.

Some of 'em might be real problems,
as overflows  like casting from "int" to "BYTE" might get us in troubles.

I will mark each modification,
so somebody more experienced can figure
out the difficult cases.

Yours,
   Leo

P.S.: whan I have done the described coding tweaks,
how shall I publish the changes?
think Is a committing using the svn OK?
The Answer is out there - "The X-Files"

Saga Musix

you can't commit to SVN correct (password protected), but you can rightclick on the code directory -> TortoiseSVN -> create patch. Then, send the patch file to relabsoluness. the patch file only saves modified lines, so he can easily see what has been changed.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.