The ChipList, by Adrian Offerman; The Processor Portal

new
Processor Selector

Platform:
Segment:
View: show / edit

bookmark bookmark site
bookmark permalink
Tue 7 Apr 2009, 20:14

variable in for-loop may not be redeclared in this scope


On Tue 7 Apr 2009, at 20:14, Intel Software Network Graphics Feed wrote:

variable in for-loop may not be redeclared in this scope

Problem : 

Intel Compiler fails to compile the following test case

void test()
{
for (int i=0; i < 1000; i++)
{
for (int i=0; i < 1000; i++); // if this is removed MSVC++ 2005 and 2008 give an error
int i;
// ...
}
}

Environment : 

 Windows, MSVC

Root Cause : 

  There are two problems

1>The problem is intel compiler generated two different variable (bug same name i) with same scope number.

2> Not allowing declaration in loop scope to confilct with associated condition-scope and for-init-scope declarations when a for loop previously appeared in the loop scope.



Resolution : 


This issue is resolved in the latest update for the Intel C++ compiler version 11.1
Filed under: Developer CommunitiesIntel SW Partner program
Source: Intel Software Network Graphics Feed
Also published by:

ChipList news channel Last Months News


ChipList developers news channel Last Months Developers News


Page viewed 2247 times since Tue 7 Apr 2009, 20:41.