Opened 15 years ago

Closed 15 years ago

#1472 closed Bugs (fixed)

foreach test breaks VC++2009

Reported by: jrp at dial dot pipex dot com Owned by: Eric Niebler
Milestone: Boost 1.35.0 Component: foreach
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

The foreach tests break the VC++2008 release compiler.

A typical result is

call_once.cpp
C:\temp\regression\boost\boost/test/impl/execution_monitor.ipp(792) : warning C4535: calling _set_se_translator() requires /EHa
c:\temp\regression\boost\boost\test\impl\execution_monitor.ipp(1017) : warning C6001: Using uninitialized memory 'old_iph': Lines: 984, 986, 987, 1000, 1002, 1006, 1013, 1014, 1015, 1017
c:\temp\regression\boost\boost\test\impl\debug.ipp(700) : warning C6320: Exception-filter expression is the constant EXCEPTION_EXECUTE_HANDLER. This might mask exceptions that were not intended to be handled
c:\temp\regression\boost\boost\test\impl\debug.ipp(701) : warning C6322: Empty _except block
c:\temp\regression\boost\boost\test\impl\debug.ipp(836) : warning C6335: Leaking process information handle 'debugger_info.hProcess'
c:\temp\regression\boost\boost\test\impl\debug.ipp(836) : warning C6335: Leaking process information handle 'debugger_info.hThread'
c:\temp\regression\boost\boost\test\impl\debug.ipp(821) : warning C6054: String 'format' might not be zero-terminated: Lines: 763, 768, 773, 774, 775, 776, 780, 787, 793, 795, 801, 802, 803, 805, 814, 820, 821
c:\temp\regression\boost\boost\foreach.hpp(388) : warning C6282: Incorrect operator: assignment of constant in Boolean context. Consider using '==' instead
..\libs\foreach\test\call_once.cpp(32) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'msc1ast.cpp', line 1411)
 To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++ 
 Help menu, or open the Technical Support help file for more information
Internal Compiler Error in C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe.  You will be prompted to send an error report to Microsoft later.

The warning relates to the following

inline bool set_false(bool &b) { return b = false; }

which can be removed by

inline bool set_false(bool &b) { b = false; return false; }

This does not remove the crash, which occurs at lines like

    BOOST_FOREACH( foreach_value_type i, rng )

or

BOOST_FOREACH(int i, get_vector())

Change History (2)

comment:1 by jrp at dial dot pipex dot com, 15 years ago

actually it only breaks code analysis

comment:2 by Eric Niebler, 15 years ago

Resolution: fixed
Status: newclosed

Fixed in [41814]

Note: See TracTickets for help on using tickets.