Watching static variables doesnt work in MSVC 4.2 but does in 5.0 
Author Message
 Watching static variables doesnt work in MSVC 4.2 but does in 5.0

In 4.2

I have declared two static variables at file scope with the same
name in two different files. However they point to different structures
(see below). When I enter main() and quickwatch max_vtx it returns
the vertexuv format instead of vertex. If I delete textarb.c then max_vtx
returns the correct data structure and I can assign the pointer OK.

In 5.0

It works as I expect.

I use MSVC4.2 over 5.0 as it has direct cable connection support.
Is this a known bug ? is there a workaround ? or am I doing something
silly ? Any help appreciated.

TIA

#ifdef __cplusplus
extern "C" {            // Assume C declarations for C++
#endif // __cplusplus

#ifndef _MISC_H
#define _MISC_H

typedef   struct  tagVertex
{
    long x,y;

Quote:
} vertex;

typedef   struct  tagVertexuv
{
    long x,y;
    long u,v;

Quote:
} vertexuv;

#endif

#ifdef __cplusplus

Quote:
}

#endif

//MAIN.C
#include "misc.h"
extern void textarb( void );

static vertex *max_vtx;
void main( void )
{
 static vertex *ptr_vtx;
 vertex test_vtx;
 test_vtx.x = 1; test_vtx.y=2;
 max_vtx=&test_vtx;
 textarb();

Quote:
}

//TEXTARB.C
#include "misc.h"
static vertexuv * max_vtx;
void textarb( void )
{
 vertexuv test_vtx;
 test_vtx.x = 1; test_vtx.y=2;
 test_vtx.u = 3; test_vtx.v=4;

 max_vtx=&test_vtx;

Quote:
}



Fri, 07 Sep 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. MSVC 4.2 watch problem

2. Changes between MSVC 4.2 and 5.0

3. MSVC 4.2 v 5.0

4. File-open button stops working in msvc++ 4.2

5. Wanted: Free STL that works well with MSVC 4.2

6. watch a static variable

7. How to see a static variable in a watch window

8. Watch a local static variable outside of function?

9. watch a static variable

10. MSVC 5.0 static file-scope init order bug

11. MSVC 4.2 Problems (MFC/non MFC)

12. using breakpoints MSVC 4.2

 

 
Powered by phpBB® Forum Software