Home Dashboard Directory Help
Search

windows headers should compile with /Za by jfire


Status: 

Closed
 as By Design Help for as By Design


5
0
Sign in
to vote
Type: Suggestion
ID: 310193
Opened: 11/14/2007 10:20:20 AM
Access Restriction: Public
0
Workaround(s)
view

Description

This probably goes to the Platform SDK team; if so, please forward it.

Please make windows headers compatible with the /Za (disable language extensions) option. This would make writing portable, standards compliant code much easier for those of us who have a mix of portable and Windows-specific files in our projects. Right now, /Za is pretty much useless for those projects, since nothing that includes windows.h will compile with it on.

In particular, this issue bites people frequently moving from VC++ without /Za to GCC: http://www.gnu.org/software/gcc/bugs.html#cxx_rvalbind. VC++ without /Za does not make this check, with /Za it does. If you could make a /Zc option that enables just that check (elided copy-constructor is callable), that would make a big difference.
Details
Sign in to post a comment.
Posted by Seth__ on 7/12/2011 at 7:28 AM
This is a real problem. We've got a project that's supposed to be portable that's been having Microsoftisms creep in because of this issue.
Posted by NoMore on 8/11/2010 at 3:50 PM
This is a serious issue and I would like to get a meaningful response too.
Posted by jfire on 5/19/2008 at 11:02 AM
Please respond to my comment before marking this Closed / By Design.

Yes, I realize that the Windows headers are platform specific.

Do you understand that making them compile with /Za is about being friendly to cross-platform developers?

Imagine you have a project with 900 cross-platform files and 100 non-portable files which include windows headers (very typical, in my experience). You cannot compile the project with /Za because the 100 non-portable files won't compile. You either have to split the portable stuff off into some sort of library (extra complexity and work) or risk introducing non-portable VC++-isms into the cross-platform files when you edit and compile them on Windows without /Za.
Posted by jfire on 11/28/2007 at 12:24 PM
Yes, I realize that the Windows headers are platform specific.

Do you understand that making them compile with /Za is about being friendly to cross-platform developers?

Imagine you have a project with 900 cross-platform files and 100 non-portable files which include windows headers (very typical, in my experience). You cannot compile the project with /Za because the 100 non-portable files won't compile. You either have to split the portable stuff off into some sort of library (extra complexity and work) or risk introducing non-portable VC++-isms into the cross-platform files when you edit and compile them on Windows without /Za.
Posted by Microsoft on 11/21/2007 at 8:52 AM
Hi: this is By-Design. The Windows headers by their very nature are platform specific and are therefore not meant to be portable.

Jonathan Caves
Visual C++ Compiler Team
Sign in to post a workaround.