Closed Bug 233809 Opened 21 years ago Closed 16 years ago

investigate /Za or /Zc:forScope compiler options to fix for loop scoping

Categories

(Firefox Build System :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: dbaron, Unassigned)

Details

Attachments

(2 files, 1 obsolete file)

We should investigate whether the compiler options that force MSVC to use the
standard for-loop scoping rules work on compilers as old as VC6.  See:

http://msdn.microsoft.com/library/en-us/vccore/html/_core_.2f.za.2c_2f.ze.asp
http://msdn.microsoft.com/library/en-us/vccore/html/vcrefzcforscope.asp

And perhaps also the pragma if some embedder uses our code without our build system:
http://msdn.microsoft.com/library/en-us/vccelng/htm/pragm_8.asp

(This would leave the HP-UX compiler as the only one without correct for-loop
scoping, I think.)
(See bug 233810 for options for the HP aCC compiler.)
Unfortunately, this option doesn't seem to be supported in MSVC 6.0.
this being /Zc:forScope.  I should try /Za, I guess...
The compiler accepts -Za, but it gives errors in the string code...
What was the nature of the errors in the string code?
Product: Browser → Seamonkey
Summary: investigate /Za or /Zc compiler options → investigate /Za or /Zc:forScope compiler options to fix for loop scoping
So if VC++ 7.1 is the oldest supported compiler on the trunk, we could add the -Zc:forScope option to the VC++ command line options and stop requiring tolerance for both for loop scoping rules on the trunk.
Product: Mozilla Application Suite → Core
Yes please.
Attached patch patch to test (obsolete) — Splinter Review
My Windows build env is still VC6, so I'm not set up to build trunk.  If somebody could try this, and check that a for loop scoping case that doesn't compile without it does compile with it, that would be great...
So this doesn't even seem to be a problem on VC8, but it would be nice if somebody tested this on VC7.1.  But I'll actually attach another patch that touches only CXXFLAGS.
So it's actually not a problem on 7.1 either.  The problem is on VC6, which doesn't even have this option.  And we still have trunk tinderboxes building with VC6.
(And, for what it's worth, I no longer have a Windows build environment, nor the energy to try to set one up.  I deleted my working VC6 environment tonight in an effort to install VC7.1.  I installed it, but when it came to setting up the environment variables I couldn't figure out which environment variables had come from my setup of VC6, what was set by various installers, etc.  So I deleted them all, plus the install of VC7.1.  Windows isn't designed for installing and upgrading software.)
Assignee: dbaron → nobody
David, is this still "wanted" in any sense?
If this is only a problem with VC6, then it's not, because we only support VC7.1 or newer on trunk.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: