 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Tue Jun 27, 2006 4:29 pm Post subject: commenting out some no-op lines leads to wrong execution |
|
|
hi,
I'm just having a weird problem that I can't explain by myself and
would appreciate someone else's view on this piece of code (used in a
JNI project). Basically if I remove some no-op lines the compiled
library does not load the file anymore. I
suspect that this comes from an error in the compile/linking chain
but can't spot it... Has anyone already face something like that ? :
void Store::load(const string& filename){
ifstream is(filename.c_str(), ios::binary | ios::in);
DataInputStream dis(&is);
Vector v;
bool test;
while(dis>>v){
addVector(v);
//no-op!!!!!!
test=false;
}
is.close();
int i=0;
//no-op!!!!!!!
cout<<dis<<" "<<i<<" "<<" "<<endl;
}
This is compiled with gcc for cygwin with options:
-mno-cygwin -Wl,--add-stdcall-alias -shared
last thing:
The unit test for this code succeed without the no-op lines... so the
pb only occurs when linked into the real library...
cheers
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|