Author Topic: shall I tweak the mptracker warnings? C4244  (Read 3516 times)

Offline Leo.Robusto

  • Active artist
  • *
  • Posts: 16
shall I tweak the mptracker warnings? C4244
« on: October 15, 2008, 21:27:10 »
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"

Offline bvanoudtshoorn

  • Extreme artist
  • *****
  • Posts: 1,053
  • Gender: Male
    • Barryvan
shall I tweak the mptracker warnings? C4244
« Reply #1 on: October 16, 2008, 01:22:32 »
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.

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,795
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
shall I tweak the mptracker warnings? C4244
« Reply #2 on: October 16, 2008, 09:26:32 »
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.

Offline Relabsoluness

  • OpenMPT Developers
  • *****
  • Posts: 709
shall I tweak the mptracker warnings? C4244
« Reply #3 on: October 16, 2008, 21:35:57 »
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.

Offline Leo.Robusto

  • Active artist
  • *
  • Posts: 16
disabled warnings for "deprecated functions"
« Reply #4 on: October 17, 2008, 22:16:17 »
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"

Offline Leo.Robusto

  • Active artist
  • *
  • Posts: 16
tweaking te code for compiler warnings
« Reply #5 on: October 20, 2008, 20:13:41 »
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"

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,795
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
shall I tweak the mptracker warnings? C4244
« Reply #6 on: October 20, 2008, 20:18:37 »
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.