Gammon Forum
Entire forum
MUSHclient
Development
Fixing up warnings so others can better contribute
Fixing up warnings so others can better contribute
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Pages: 1 2
3
4
Posted by
| Worstje
Netherlands (899 posts) bio
|
Date
| Thu 16 Sep 2010 12:14 AM (UTC) Amended on Thu 16 Sep 2010 12:15 AM (UTC) by Worstje
|
Message
| I recall (what must by now be a pretty long time ago) that Twisol once started to fix up MUSHclient warnings in recent compilers. But when I spoke to him it came up that Nick apparently never merged any of the fixes he brought up, and by now it would probably be a lost cause given the amount of new versions that have come out.
Since I hope to contribute, I'd like to pick up on that warnings-squashing project, since it is pretty much impossible to see the trees in the forest of warnings that even a partial build tends to throw up.
Thus, my question to Nick is - are you willing to bring such fixes into your master, or did you have some sort of issues with it?
I have zero intention of forking MUSHclient, and if anything 'new' that I code up can't be merged due to me fixing those warnings, it'd be a pretty useless endeavour, so I'd prefer to know before I spend too much time on such a project.
So far, I put up a few branches on github in case any of you want to check out compatibility with VC++6, but it is all trivial thus far. | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #1 on Thu 16 Sep 2010 12:32 AM (UTC) Amended on Thu 16 Sep 2010 12:39 AM (UTC) by Nick Gammon
|
Message
| |
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #2 on Thu 16 Sep 2010 12:35 AM (UTC) Amended on Thu 16 Sep 2010 12:39 AM (UTC) by Twisol
|
Message
| Sorry if I wasn't totally clear, Worstje; the problem was that I spent so much time doing warnings mixed with stylistic cleanups, and it was such a mess that Nick really couldn't pull things in like that. It was only worthwhile to just re-fix actual bugs I brought up. And since the warnings are just that - warnings - it wasn't important for him to spend the time plucking these cleanups out of my commit chain.
[EDIT] Nick, you mentioned ff972aec6b twice in that set of links. ;)
[EDIT] And unless I'm quite mistaken, you actually made the 91abdc79ff change; I had simply merged it into my branch, and you later merged my branch into your branch.
http://github.com/nickgammon/mushclient/commit/99c6eea839d641d930e7dcb42633d8670c321b62 |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #3 on Thu 16 Sep 2010 12:38 AM (UTC) |
Message
| If you stick to eliminating compiler warnings that would be great, because then when I update the compiler one day, it will work for me too. :)
So that would be appreciated. And of course if in the process of browsing you spot bugs, well I am glad to hear about them too. Twisol has found a few so far, and their fixes are gratefully received and acknowledged. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #4 on Thu 16 Sep 2010 12:39 AM (UTC) |
Message
|
Nick Gammon said: If you stick to eliminating compiler warnings that would be great, because then when I update the compiler one day, it will work for me too. :)
Did you just say "when"? Wow, there's hope! |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #5 on Thu 16 Sep 2010 12:41 AM (UTC) |
Message
|
Twisol said:
Nick, you mentioned ff972aec6b twice in that set of links. ;)
And unless I'm quite mistaken, you actually made the 91abdc79ff change; I had simply merged it into my branch, and you later merged my branch into your branch.
Fixed double posting - I must have gone through the list twice, or in two different ways (I think I searched for Twisol and then your real name).
As for who made the change, it was tagged "Twisol (author)". I think we discussed a while back that this was a bit misleading, but you got the credit. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Worstje
Netherlands (899 posts) bio
|
Date
| Reply #6 on Thu 16 Sep 2010 12:54 AM (UTC) |
Message
| My apologies for my claim of you never merging anything, Nick. I didn't doublecheck against the log of commits done and obviously misunderstood Twisol. :)
And I hadn't spotted that commit yet. Still finding my way on Github, obviously, but glad to see you're more on top than I thought you were. Kudos!
I do intend to stick to fixing compiler warnings only on my vs2010_warnings branch. | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #7 on Thu 16 Sep 2010 01:03 AM (UTC) |
Message
|
Worstje said:
And I hadn't spotted that commit yet. Still finding my way on Github, obviously, but glad to see you're more on top than I thought you were. Kudos!
Well, only just. :)
I had to fetch and then merge it. Should be faster next time.
My compile gives me:
--------------------Configuration: MUSHclient - Win32 Debug--------------------
Compiling...
globalregistryoptions.cpp
Linking...
nafxcwd.lib(wincore.obj) : error LNK2005: _g_fMultiMonInitDone already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _g_pfnEnumDisplayMonitors already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _g_pfnGetMonitorInfo already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _g_pfnMonitorFromPoint already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _g_pfnMonitorFromRect already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _g_pfnMonitorFromWindow already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _g_pfnGetSystemMetrics already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _InitMultipleMonitorStubs already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _xGetSystemMetrics@4 already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _xMonitorFromPoint@12 already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _xMonitorFromRect@8 already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _xMonitorFromWindow@8 already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _xGetMonitorInfo@8 already defined in winplace.obj
nafxcwd.lib(wincore.obj) : error LNK2005: _xEnumDisplayMonitors@16 already defined in winplace.obj
nafxcwd.lib(wincore.obj) : warning LNK4006: _g_fMultiMonInitDone already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _g_pfnEnumDisplayMonitors already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _g_pfnGetMonitorInfo already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _g_pfnMonitorFromPoint already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _g_pfnMonitorFromRect already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _g_pfnMonitorFromWindow already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _g_pfnGetSystemMetrics already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _InitMultipleMonitorStubs already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _xGetSystemMetrics@4 already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _xMonitorFromPoint@12 already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _xMonitorFromRect@8 already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _xMonitorFromWindow@8 already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _xGetMonitorInfo@8 already defined in winplace.obj; second definition ignored
nafxcwd.lib(wincore.obj) : warning LNK4006: _xEnumDisplayMonitors@16 already defined in winplace.obj; second definition ignored
Creating library .\WinDebug/MUSHclient.lib and object .\WinDebug/MUSHclient.exp
.\WinDebug/MUSHclient.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
MUSHclient.exe - 15 error(s), 14 warning(s)
If I comment out this line it works:
#define COMPILE_MULTIMON_STUBS
So you need to find a way of making a compiler-version test to put around it. Or I can try to find it.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #8 on Thu 16 Sep 2010 01:05 AM (UTC) |
Message
| Nick, Worstje, what if you replace 'multimon.h' with 'windows.h'? I suggested this in another thread, and it was the solution I used when I first started with the source. Since you both have different windows.h's anyways (I'm pretty sure), I think it should work without too much pain. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #9 on Thu 16 Sep 2010 01:06 AM (UTC) |
Message
| This seems to work for me:
#if _MSC_VER > 1200
#define COMPILE_MULTIMON_STUBS
#endif
Now if it works for you too, we can run with that. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #10 on Thu 16 Sep 2010 01:09 AM (UTC) |
Message
|
Twisol said:
Nick, Worstje, what if you replace 'multimon.h' with 'windows.h'? I suggested this in another thread, and it was the solution I used when I first started with the source. Since you both have different windows.h's anyways (I'm pretty sure), I think it should work without too much pain.
Doesn't work.
--------------------Configuration: MUSHclient - Win32 Debug--------------------
Compiling...
winplace.cpp
C:\source\mushclient\winplace.cpp(46) : error C2065: 'HMONITOR' : undeclared identifier
C:\source\mushclient\winplace.cpp(46) : error C2146: syntax error : missing ';' before identifier 'hMonitor'
C:\source\mushclient\winplace.cpp(46) : error C2065: 'hMonitor' : undeclared identifier
C:\source\mushclient\winplace.cpp(47) : error C2065: 'MONITORINFO' : undeclared identifier
C:\source\mushclient\winplace.cpp(47) : error C2146: syntax error : missing ';' before identifier 'mi'
C:\source\mushclient\winplace.cpp(47) : error C2065: 'mi' : undeclared identifier
C:\source\mushclient\winplace.cpp(52) : error C2065: 'MonitorFromRect' : undeclared identifier
C:\source\mushclient\winplace.cpp(52) : error C2065: 'MONITOR_DEFAULTTONEAREST' : undeclared identifier
C:\source\mushclient\winplace.cpp(57) : error C2228: left of '.cbSize' must have class/struct/union type
C:\source\mushclient\winplace.cpp(58) : error C2065: 'GetMonitorInfo' : undeclared identifier
C:\source\mushclient\winplace.cpp(60) : error C2228: left of '.rcWork' must have class/struct/union type
Error executing cl.exe.
winplace.obj - 11 error(s), 0 warning(s)
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #11 on Thu 16 Sep 2010 01:17 AM (UTC) |
Message
|
Nick Gammon said:Doesn't work.
--------------------Configuration: MUSHclient - Win32 Debug--------------------
Compiling...
winplace.cpp
C:\source\mushclient\winplace.cpp(46) : error C2065: 'HMONITOR' : undeclared identifier
C:\source\mushclient\winplace.cpp(46) : error C2146: syntax error : missing ';' before identifier 'hMonitor'
C:\source\mushclient\winplace.cpp(46) : error C2065: 'hMonitor' : undeclared identifier
C:\source\mushclient\winplace.cpp(47) : error C2065: 'MONITORINFO' : undeclared identifier
C:\source\mushclient\winplace.cpp(47) : error C2146: syntax error : missing ';' before identifier 'mi'
C:\source\mushclient\winplace.cpp(47) : error C2065: 'mi' : undeclared identifier
C:\source\mushclient\winplace.cpp(52) : error C2065: 'MonitorFromRect' : undeclared identifier
C:\source\mushclient\winplace.cpp(52) : error C2065: 'MONITOR_DEFAULTTONEAREST' : undeclared identifier
C:\source\mushclient\winplace.cpp(57) : error C2228: left of '.cbSize' must have class/struct/union type
C:\source\mushclient\winplace.cpp(58) : error C2065: 'GetMonitorInfo' : undeclared identifier
C:\source\mushclient\winplace.cpp(60) : error C2228: left of '.rcWork' must have class/struct/union type
Error executing cl.exe.
winplace.obj - 11 error(s), 0 warning(s)
...Bizzare. The MSDN docs for MonitorFromRect (for example) say to include windows.h. Maybe it's just because you're using VC6. Guess we'll have to go with the version #if... |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Worstje
Netherlands (899 posts) bio
|
Date
| Reply #12 on Thu 16 Sep 2010 01:18 AM (UTC) |
Message
| Heh, I'm too slow around here. Seems we found the same fix (be it written a bit differently). Already sent you a pull request, not sure which version is better. Upto you. :) | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #13 on Thu 16 Sep 2010 01:48 AM (UTC) |
Message
| That seems to have worked. This is how I grabbed your stuff BTW:
# pull your stuff
git fetch http://github.com/worstje/mushclient.git vs2010_fixes
# merge this commit
git merge 08361f312f14f88ff97c
# compare to previous version of MUSHclient
git diff v4.61 -- winplace.cpp
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #14 on Thu 16 Sep 2010 01:51 AM (UTC) Amended on Thu 16 Sep 2010 01:54 AM (UTC) by Nick Gammon
|
Message
| With some of these warnings (fixes):
//----------------------------------------
// world.BlendPixel
//----------------------------------------
static int L_BlendPixel (lua_State *L)
{
CMUSHclientDoc *pDoc = doc (L);
lua_pushnumber (L, pDoc->BlendPixel (
(long) my_checknumber (L, 1), // Blend
(long) my_checknumber (L, 2), // Base
(short) my_checknumber (L, 3), // Mode
my_optnumber (L, 4, 1) // Opacity
));
return 1; // number of result fields
} // end of L_BlendPixel
Can't you just #pragma them away? Don't you think the resulting code looks ugly? And I am a bit averse to having casts everywhere, they can hide other problems. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
116,619 views.
This is page 1, subject is 4 pages long: 1 2
3
4
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.