63 | | You might also try compiling with the /Za option to disable MS extensions, but this may not be as useful as one might hope for reasons explained by Stephan T. Lavavej from the Microsoft STL team in an authoritative post at [http://article.gmane.org/gmane.comp.lib.boost.devel/212186/] /Za and Warning Guidelines for VC. |
64 | | |
65 | | Briefly, there are several problems. Firstly, the latest compilers, especially VC10, is "pretty conformant" and so code is likely to be portable anyway. Secondly, there is a bug which means that valid code fails to compile, and this is not expected to be fixed for some time. Thirdly, is the possible need to link to other libraries, for example regex, that also '''must''' be built with the /Za option. But there is no way to distinguish libraries built with and without this option by filename, so that they cannot co-exist: this is a recipe for trouble! |
| 63 | You might imagine that it would be a good idea to compile with the /Za option to disable MS extensions, but this will not be as useful as one might hope for reasons explained by Stephan T. Lavavej from the Microsoft STL team in an authoritative post at [http://article.gmane.org/gmane.comp.lib.boost.devel/212186/] /Za and Warning Guidelines for VC. |
| 64 | And more seriously, when using Boost libraries, standard-conforming name lookup is broken.See [https://connect.microsoft.com/VisualStudio/feedback/details/486253/name-lookup-broken-with-za] and note that is has a '''won't fix''' status. |
| 65 | |
| 66 | Briefly, '''don't use /Za for ANYTHING. It's broken.''' |
| 67 | |
| 68 | There are several problems. Firstly, the latest compilers, especially VC10, is "pretty conformant" and so code is likely to be portable anyway. Secondly, there is a compiler bug(s) which means that valid standard-conforming code fails to compile, and this is marked 'won't fix'. Thirdly, is the probable need to link to other libraries, for example regex, serialization that also '''must''' be built with the /Za option, but some will fail to compile. Finally, since there is no way to distinguish libraries built with and without this option by filename, so that they cannot co-exist: this is a recipe for confusion and trouble! |
69 | | Having said that, if you only have access to a Microsoft platform, before launching code on the full array of testers, you might consider checking if any indications of non-portability emerge from testing with language extensions disabled. |
| 72 | You might also consider using Microsoft /Wall if available. You may find |
| 73 | [http://www.geoffchappell.com/viewer.htm?doc=studies/msvc/cl/c1xx/warnings/index.htm&tx=2,27&ts=0,3820] |
| 74 | a helpful guide to the byzantine complexity of warnings.[[BR]] |
| 75 | |
| 76 | Having said that, if you only have access to a Microsoft platform, before launching code on the full array of testers, you might consider checking if any indications of non-portability emerge from testing with language extensions disabled. But you will probably just find spurious compilation failures. |
98 | | (You might also consider using Microsoft /Wall if available. You may find |
99 | | [http://www.geoffchappell.com/viewer.htm?doc=studies/msvc/cl/c1xx/warnings/index.htm&tx=2,27&ts=0,3820] |
100 | | a helpful guide to the byzantine complexity of warnings).[[BR]] |
101 | | |
102 | | (If you '''really''' wish to make '''all''' of your VS projects in ''' all''' VS solutions compile with other options '''by default''', you might consider (carefully) editing (with a text editor, very carefully, after keeping a copy of the original) the file C:\Program Files\Microsoft Visual Studio 9.0\VC\VCWizards\1033\common.js to change from the Microsoft defaults. This does not seem to be officially documented as far as I know. It may save you changing the project properties repeatedly. |
| 105 | |
| 106 | (If you '''really''' wish to make '''all''' of your VS projects in ''' all''' VS solutions compile with other options '''by default''', you might consider (carefully) editing (with a text editor, very carefully, after keeping a copy of the original) the file C:\Program Files\Microsoft Visual Studio 9.0\VC\VCWizards\1033\common.js |
| 107 | |
| 108 | (or similarly C:\Program Files\Microsoft Visual Studio 10.0\VC\VCWizards\1033\common.js for VC 10) to change from the Microsoft defaults. This does not seem to be officially documented as far as I know. It may save you changing the project properties repeatedly (and is especially useful if you find that because of previous choices, the project wizard's default is to disable extensions). |