473,394 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

a real strange C4288

I was working on some code that compiled with vc6, eg.g

for(int i;i<x;);
if(i<j)
{// etc

which I rewrote to

int i = 0;
for(i = n;i<x;);
if(i<j)
{// etc

to make it more compliant, but strangely I got a
warning C4288: nonstandard extension used : 'i' : loop control variable
declared in the for-loop is used outside the for-loop scope; it
conflicts with the declaration in the outer scope

This is boggling my mind, because i is NOT declared in the for-loop. Any
ideas?

thanks,
max
Nov 17 '05 #1
2 1195
>I was working on some code that compiled with vc6, eg.g

for(int i;i<x;);
if(i<j)
{// etc

which I rewrote to

int i = 0;
for(i = n;i<x;);
if(i<j)
{// etc

to make it more compliant, but strangely I got a
warning C4288: nonstandard extension used : 'i' : loop control variable
declared in the for-loop is used outside the for-loop scope; it
conflicts with the declaration in the outer scope

This is boggling my mind, because i is NOT declared in the for-loop. Any
ideas?


Have you got a complete compilable snippet that illustrates the
problem?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2
Just check if 'i' is not re-declared in the for loop. Else add the compiler option /Zc:forScope which will tell that the standard C++ behavior of for loop to be followed in the program.

Balaji

"maxim khesin" wrote:
I was working on some code that compiled with vc6, eg.g

for(int i;i<x;);
if(i<j)
{// etc

which I rewrote to

int i = 0;
for(i = n;i<x;);
if(i<j)
{// etc

to make it more compliant, but strangely I got a
warning C4288: nonstandard extension used : 'i' : loop control variable
declared in the for-loop is used outside the for-loop scope; it
conflicts with the declaration in the outer scope

This is boggling my mind, because i is NOT declared in the for-loop. Any
ideas?

thanks,
max

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: matthias | last post by:
hello everybody, i want to capture traffic in promiscous mode from ethernet adapter. i have visual studio and the framework sdk installed. i have read at the msdn library about the network...
2
by: cwdjr | last post by:
Real One has a page to copy on their site that detects if the browser of a viewer of a page has Real One installed. The page is located at...
3
by: Hermit Crab | last post by:
I'm seeing some unexpected (at least to me) behavior in the 'window' and 'document' objects under Netscape 7.1 and Internet Explorer 6.0. When a property is added to the prototype for 'Object',...
2
by: russianthug | last post by:
Hello, All. It may seem a strange question, but what I need is an original English quotation from "C++ For Real Programmers" by Jeff Alger. These couple of sentenses are about how "ugly C++ is...
12
by: Russ | last post by:
I'm interested in setting up a web page where live data can be displayed in real-time on the web page. For example: I would like to display a (nice looking) graph of some data value versus time...
2
by: Charl | last post by:
Hello, I’ve got a very strange but big deployment problem. I’ve written an asp.net application with an usercontrol on a webform. The usercontrol reads all picture names out of a mssql...
10
by: Sharrukin Amiri | last post by:
Hello, 1. Is anybody building Stand-Alone Apps with VB.NET in the real world? 2. If using VB.NET, are you using the new functionalities of VB.NET or using VB 6.0 functionality? 3. How...
20
by: SpreadTooThin | last post by:
I have a list and I need to do a custom sort on it... for example: a = #Although not necessarily in order def cmp(i,j): #to be defined in this thread. a.sort(cmp) print a
3
by: bsc_demos | last post by:
Hello there, I need to built a programm in C#, that will transmit real time video from my webcam. I am a beginer in programming and I really don't know where to start from. Can anybody help me...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.