Re: Building from existing files - was Bypassing the Conversion Wi
- From: Paul Hager <paul.hager@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Mar 2009 06:17:02 -0700
I do appreciate the assistance and I'll certainly provide more details should
I have a problem in the future - as I did with the posting for the C4267
problem.
With respect to this particular project, you are correct that the software
is obsolete. So is the hardware - it was already approaching obsolescence
when it began to be installed on USN combat vessels in the late 1970's. The
economics of doing a complete rewrite of the software are prohibitive. This
is not an option. It is not my choice. I have developed a separate, stand
alone piece of software that does follow current (as of VS 2005) Microsoft
practice. It's a lot cleaner than the 12-year-old software at issue here and
it also performs the same I/O substantially faster.
I've checked around and I'm the only person here at Crane who doing
maintenance/development using Microsoft - everyone else appears to be using
Linux. That makes it more difficult since there is no one here to consult -
I'm left with consulting with people online. Another difficulty is that
because much of the work is secret, I have no internet access in the lab and
that means that any online help necessitates leaving the lab and going to my
workstation.
While this particular piece of code is not secret, I'm still loath to post
large swatches of code online. And, in this particular instance, there
really wasn't a need to post more than I did in order to answer this one
question. I trust we agree that it is best to strive for parsimony whenever
possible.
Regards,
Paul Hager
--
Maritime Electronic Warfare, Crane NSWC
"Joseph M. Newcomer" wrote:
They disappeared because your code is obsolete. You should upgrade the code to be.
consistent with modern practice.
You continue the poor posting practice by given an example that uses a variable whose
declaration is not shown.
When you post an example, you *will* show the declarations of all of your variables!
You have not justified why you are using the obsolete data type 'char' to represent text,
or why 300 makes sense (for example, a CString would probably be a better choice). But if
you read the definition of strlen, it states that it is
size_t strlen(const char * str);
so it means that strlen is returning a size_t. A size_t can be 64 bits wide, therefore,
using an int variable (and I'm only guessing, since you couldn't be bothered to show us
the declaration) you should have been using a size_t variable.
Reading the documentation always helps.
joe
On Mon, 30 Mar 2009 09:37:03 -0700, Paul Hager <paul.hager@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
I already acknowledged I should have provided an example. Once I set theJoseph M. Newcomer [MVP]
Project Properties as indicated, the code compiled and the C2665 errors
disappeared.
Unless there is a good reason to change the code, I see no advantage in it.
Is there a good reason?
As for the other error, it is C4267 and it arises as follows:
char temp[300];
...
j = strlen(temp) - 1; // C4267 error size_t to int
I assume there is a switch that will handle this as well. Since strlen is a
standard C function I can't think of any reason why this shouldn't work as
written. And, I reiterate, it does compile correctly in both the (currently
running) 4.2 version and the VS 2005 conversion wizard output.
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Follow-Ups:
- Re: Building from existing files - was Bypassing the Conversion Wi
- From: Joseph M . Newcomer
- Re: Building from existing files - was Bypassing the Conversion Wi
- References:
- Building from existing files - was Bypassing the Conversion Wizard
- From: Paul Hager
- Re: Building from existing files - was Bypassing the Conversion Wizard
- From: Joseph M . Newcomer
- Re: Building from existing files - was Bypassing the Conversion Wi
- From: Paul Hager
- Re: Building from existing files - was Bypassing the Conversion Wi
- From: Joseph M . Newcomer
- Re: Building from existing files - was Bypassing the Conversion Wi
- From: Paul Hager
- Re: Building from existing files - was Bypassing the Conversion Wi
- From: Joseph M . Newcomer
- Building from existing files - was Bypassing the Conversion Wizard
- Prev by Date: ListBox with ctrl-c and other ctrl keys.
- Next by Date: Re: ListBox with ctrl-c and other ctrl keys.
- Previous by thread: Re: Building from existing files - was Bypassing the Conversion Wi
- Next by thread: Re: Building from existing files - was Bypassing the Conversion Wi
- Index(es):
Relevant Pages
|