Craig said:
But it *is* broken as far as the C standard is concerned.
Look, it is not the C standard that runs my code.
It is a mindless processor, churning instruction after instruction, no
mind no standards, no nothing.
I have an aesthetic view of code. What is important in it, from my
viewpoint, is clarity of design and above all, that
IT WORKS.
Code can be written up to the best standards, but if doesn't work or if
it doesn't perform very well I do not care. It is ugly.
The code I am porting is the code of the IDE of lcc-win, and the code of
the debugger. I started writing it around 1992.
The IDE was one of the few pieces of code I salvaged from my failed
lisp interpreter project, that was a technical success but a commercial
failure.
It has been ported to windows 16 bits (from 32 bit DOS emulator with
Delorie), then ported to windows 32 bits in 1996 (windows 95), then
ported to linux 32 bits , under GTK, and then to windows 64 bits.
Believe me, I know what porting means, what is important in code
what is not.
If one believes in the engineering aspect of software development,
then maintenance is part of the deal. As pointed out elsewhere in
this thread, size_t has been around for 18 years so having to deal
with it should not exactly be a surprise.
Yeah. I have to cope with the possibility of strings larger than 2GB.
Gosh!
That being said, you are free to either deal with updating your code
or to ignore the compiler warnings. It all depends on how much you
and those others who use the code care about it working correctly and
how difficult it is to port to other compilers, platforms, operating
systems, etc., when needed.
I think that the fix proposed will fit the bill.
As an example of consequences of not keeping code up to date, I've
spent something in excess of a week getting a network communications
package for a little I/O box embeded in one of our systems to compile
and work correctly after an OS/compiler upgrade of the system needing
to use the I/O box. It turns out that the latest version of the
software package supplied by the vender is *full* of pre C89 crud.
You will agree with me that THAT is much serious than a few compiler
warnings because of size_t I suppose...
I adopted immediately C89 when it come out, because of the prototypes.
It was an INCREDIBLE relaxing thing that I did NOT have to worry
anymore if I always passed the right number of parameters to my
functions. The compiler would yell at me. What a fantastic feeling.
I still remember it!
I now have the system working again to the point that it is useful,
however the porting hassles serve as a disincentive for purchasing any
more of the company's products.
Sorry but did you contact the vendor? If they still exists and
sell that package they have surely upgraded it...