|
-
May 3rd, 2011, 05:02 AM
#1
[RESOLVED] Differences in Code Generation Between C and C++ Compilers
I have an old program that is a Windows API program written in C. When I inherited the project, even though all the code was C, some of the files were cpp files. I know the C++ compiler catches more than the C compiler.
I had to add in some third party code that was a C++ class and made some other changes that were causing the linker to have problems with the types across the C and C++ modules, so I renamed all the modules to .CPP. It links and runs, but the code doesn't work right.
The program is a hardware test program that is supposed to put some hardware through its paces and generation a calibration file that is used by other programs. On the version compiled before I made the change to CPP, the tests run without errors on the hardware. With the all CPP file version, I'm getting a set of errors in one part of the program.
I have experimented commenting out all my changes and the same problems crop up.
I tried changing the optimization and I got different errors, but they were from the same part of the program. At this point, I'm beginning to think that there is something different about the code created with the C++ compiler that is causing the problems.
I am sure there is something structurally wrong with the code that was masked by compiling in C. I also believe there are some differences in calling conventions between C and C++, but I'm not sure what they are.
So my question is what are the differences in code between C compiled under C and under the C++ compilers? I'm using VC 2005 Pro BTW.
Thanks,
Bill
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|