S
shane.tietjen
Working in VS 2003.
in a header file:
[test.h]
#ifdef _UNUSED_NAME_3223458 //this is not defined anywhere at anytime
#define TEST123 6789
#endif
[\test.h]
in the implementation file:
[test.cpp]
\\the value of TEST123 will be 6789 or whatever value is assigned to it
even though _UNUSED_NAME_3223458 was never defined and is not present
in any other files.
[\test.cpp]
Also, if you do:
#ifndef _UNUSED_NAME_3223458
#define TEST123 0
#endif
Insert this prior to the other one(so you test for not defined before
defined), TEST123 will have a value of 0 and not 6789.
No errors or warnings.
It is almost as if the variable you testing( _UNUSED_NAME_3223458 which
is never defined at any time) is in an unknown state at the time you
test it.
What is going on here?
in a header file:
[test.h]
#ifdef _UNUSED_NAME_3223458 //this is not defined anywhere at anytime
#define TEST123 6789
#endif
[\test.h]
in the implementation file:
[test.cpp]
\\the value of TEST123 will be 6789 or whatever value is assigned to it
even though _UNUSED_NAME_3223458 was never defined and is not present
in any other files.
[\test.cpp]
Also, if you do:
#ifndef _UNUSED_NAME_3223458
#define TEST123 0
#endif
Insert this prior to the other one(so you test for not defined before
defined), TEST123 will have a value of 0 and not 6789.
No errors or warnings.
It is almost as if the variable you testing( _UNUSED_NAME_3223458 which
is never defined at any time) is in an unknown state at the time you
test it.
What is going on here?