I just did a quick experiment. If I have two source modules, say, main.cpp:
int x;
int sub();
main()
{
x = 3;
sub();
return 0;
}
and sub.cpp:
int x;
sub()
{
x = 4;
return 0;
}
with the same global variable x in both files, the class view in the project
workspace has two entries for x. When I build, the linker complains about
the duplicated definition of variable “x”. The browser then refuses to pick
it up.
The old C standard was that if two modules declared the same variable, that
was melded into one common global, but I believe this is no longer legit. I
believe this behavior of MSVC 6 is correct, but I’m not that familiar with
the standard.
Alberto.
-----Original Message-----
From: Michal Vodicka [mailto:xxxxx@veridicom.cz.nospam]
Sent: Wednesday, June 06, 2001 3:44 PM
To: NT Developers Interest List
Subject: [ntdev] Re: settings for creating browsing file
This way you build one BSC file from all toaster subprojects, right? This
can cause problems as more variable instances of the same name from
different binaries, too much refrerences and modules list containing all
source files and not just sources for current binary. Also it disables some
analysis possibilities. That’s why I prefer one BSC database per
SOURCES/result binary.
Maybe it isn’t a problem with VC browser. What it does when you look for a
(function, variable) definition and there are more instances in different
files? (I haven’t used VC IDE for years
Best regards,
Michal Vodicka
Veridicom
(RKK - Skytale)
[WWW: http://www.veridicom.com , http://www.skytale.com]
From: James Antognini[SMTP:antognini@us.ibm.com]
Reply To: NT Developers Interest List
Sent: Wednesday, June 06, 2001 4:44 PM
To: NT Developers Interest List
Subject: [ntdev] Re: settings for creating browsing file
Note, however, that if your project has a source tree with, say, a dirs
file and several sources files, you’re going to have to be a little
fancier in using DDKBUILD (thanks to Mark Roddy, who clarified this
behavior for me). DDKBUILD will employ a file called sbrList.txt (or
variants on that name) in order to take intermediate .sbr files and, via
a build program called bscmake, turn them into your desired, integrated
.bsc file. In a case of mine, sbrList.txt took this form (for the DDK
toaster examples):
/n /o Toaster.bsc
.\bus\objchk\i386*.sbr
.\coinstaller\objchk\i386*.sbr
.\exe\enum\objchk\i386*.sbr
.\exe\notify\objchk\i386*.sbr
.\exe\toast\objchk\i386*.sbr
.\func\objchk\i386*.sbr
.\toastmon\objchk\i386*.sbr
I believe the srbList.txt file has to be in the same top-level directory
as the dirs file.
–
James Antognini
IBM Watson Research
You are currently subscribed to ntdev as: xxxxx@rkk.cz
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com