With regard to MSVC 2012, I read something about it having an express edition limited in compilation possibilities. Is it possible to compile OpenTTD with an express edition of MSVC 2012?
OK, I see. I can test with the express edition some day soon.
Nevertheless, I'm writing standard C++ code, not using Microsoft language extensions. However, with VS2012 I'm of course tempted to use new supported C++11 features like lambda functions and concurrency to improve performance and readability. I guess that's not acceptable for compatibility reasons with old compilers. The current code style is not very modern C++. Where do you draw the line? Does it have to build on some compiler X?
See http://vcs.openttd.org/svn/browser/trun ... e.txt#L431 for a list of supported compilers. I can't help you with regard to which compilers support C++11 features and which ones don't. I also don't know if we need to avoid C++11 for compatibility.
With regard to Microsoft extensions, as long as they are not supported by most compilers in that list I know for sure that they are not an option for us
Amaroker wrote:OK, I see. I can test with the express edition some day soon.
Nevertheless, I'm writing standard C++ code, not using Microsoft language extensions. However, with VS2012 I'm of course tempted to use new supported C++11 features like lambda functions and concurrency to improve performance and readability. I guess that's not acceptable for compatibility reasons with old compilers. The current code style is not very modern C++. Where do you draw the line? Does it have to build on some compiler X?
I don't think we have a rule for this, but we still have a project file for MSVC 2005. While support for that version might be dropped sometime, it should definitely compile on 2008.
Thanks for the replies. OK, I can live with that for now
Until the compilers catch up, I can see there is much other maintenance needed. Running the analyze tool of VS2012 shows a great lot of possible memory leaks and other warnings. CLANG will probably find even more. So, I will download the express version and start patching
Amaroker wrote:Running the analyze tool of VS2012 shows a great lot of possible memory leaks and other warnings.
With VS2010 the vast majority of these 'possible memory leaks' were false positives; we use Vehicle *v = new Vehicle(); to put something in a pool, but then don't delete it before v goes out of scope. The compiler thinks it leaks memory, but in fact it does not because new (or the constructor) silently adds the allocated memory to a lookup table.
I read that the Express edition of VC 2012 will only allow you to build Metro applications, and not standard Windows desktop applications.
It also seems to be the case that the VC 2012 compiler will only generate binaries that work on Vista or later, and not XP SP3 (or, indeed, earlier versions, which are already unsupported by VC 2010).
orudge wrote:I read that the Express edition of VC 2012 will only allow you to build Metro applications, and not standard Windows desktop applications.
It also seems to be the case that the VC 2012 compiler will only generate binaries that work on Vista or later, and not XP SP3 (or, indeed, earlier versions, which are already unsupported by VC 2010).
Microsoft stepped back and now VC 2012 Express will compile desktop applications.