Very big bug in .NET and Intellisense (VC++)!!!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Try these lines of code, after create a new Win32 project, in a cpp module you choose.
Define a macro and two struct like this:

#define ParmEq(a,b) (fabs((double)(a-b)) <= 0.00001)

struct t_point
{
double x;
double y;
}
struct t_box
{
t_point min;
t_point max;
};

Then in a body function write:

t_box box;

If( ParmEq( 10, box.min.x ) )

When you write the dot after "box", Intellisense display correctly the min/max members of the struct; when you write the dot after min, Intellisense don't display anything, write the "x" and when you press the space, VS stop responding for about 30 seconds.
Now open Task Manager, go to Performance page and look at PF usage: mine arrive to 1.66 GB (!!!), starting about at 200MB. If I close VS, all returns to original state.
But the very strange thing is that if you change the member names of t_box struct (e.g. minimum,maximum) all seems OK!

This behaviour occurs in all developing computers of our dept.; whe have Windows XP with SP1, VS .NET 2003 version 7.1.3088, .NET Framework version 1.1.4322 with Visual Basic/Visual C++/Visual C#. All computers have 1GB RAM.

Can someone explain where am I wrong or if it's a bug?

Thanks everybody,
Giuseppe Paoletti
 
Possibly because yours are not the only definitions of "min" and "max".

Giuseppe said:
Hello,

Try these lines of code, after create a new Win32 project, in a cpp module you choose.
Define a macro and two struct like this:

#define ParmEq(a,b) (fabs((double)(a-b)) <= 0.00001)

struct t_point
{
double x;
double y;
}
struct t_box
{
t_point min;
t_point max;
};

Then in a body function write:

t_box box;

If( ParmEq( 10, box.min.x ) )

When you write the dot after "box", Intellisense display correctly the
min/max members of the struct; when you write the dot after min,
Intellisense don't display anything, write the "x" and when you press the
space, VS stop responding for about 30 seconds.
Now open Task Manager, go to Performance page and look at PF usage: mine
arrive to 1.66 GB (!!!), starting about at 200MB. If I close VS, all returns
to original state.
But the very strange thing is that if you change the member names of t_box
struct (e.g. minimum,maximum) all seems OK!
This behaviour occurs in all developing computers of our dept.; whe have
Windows XP with SP1, VS .NET 2003 version 7.1.3088, .NET Framework version
1.1.4322 with Visual Basic/Visual C++/Visual C#. All computers have 1GB RAM.
 
Stephen Bye said:
Possibly because yours are not the only definitions of "min" and "max".

Maybe, but they are obviously related to the struct definitions, not to the min/max macro.
Otherwise, if you change the macro ParmEq into a function, everything is fine.
Thanks for reply.
 
Maybe, but they are obviously related to the struct definitions, not
to the min/max macro. Otherwise, if you change the macro ParmEq into a
function, everything is fine. Thanks for reply.

In VS2002/2003, IntelliSense did not parse macros correctly all the time.
That's why you're seeing this bug.

We fixed this in VS2005 (currently pre-Beta) along with correctly parsing
namespaces, templates and tracking macro state.

Thanks,
 
Back
Top