Re: Is necessary to switch to C++ or some object-oriented language?



On Mar 23, 11:39 am, "Default User" <defaultuse...@xxxxxxxxx> wrote:
Richard Bos wrote:
"J. J. Farrell" <j...@xxxxxxxxxx> wrote:

On Mar 22, 11:48 am, "user923005" <dcor...@xxxxxxxxx> wrote:
On Mar 21, 7:16 pm, "J. J. Farrell" <j...@xxxxxxxxxx> wrote:

On Mar 21, 2:14 pm, "user923005" <dcor...@xxxxxxxxx> wrote:

I suppose it hinges on what you consider "minor", but please
specify why you consider this claim to be false. It's very rare
for programs to need to call main() recursively, or to care
about the type of a charater constant, for example. The need to
cast void * to other object pointer types is slightly more
intrusive, but I'd still consider it minor. Which are the
non-minor exceptions?

Take this
tarball:http://wwwmaster.postgresql.org/download/mirrors-ftp?file=
%2Fsource%2... Which is the PostgreSQL database (written in the
C language). Rename all of the .c files to .cpp and try to
compile it. Basically none of the files will compile.

I don't see how that's relevant to the question. If the minor
exceptions are widely used, there'll obviously be problems
compiling.

If they're widely used, I wouldn't call them minor. Some people would
say that the differences between a monkey's genome and a human's are
minor; but the differences between the resulting money and human
definitely aren't.

The common set of C and C++ is pretty broad and useful if one has some
reason to use it. I haven't personally ever needed it.

As far as porting from one language to another, C->C++ is one of the
easiest to do. For the most part, the programs will be broadly
structured correctly, and most the standard headers are acceptable
(except possibly C99 ones) although they should probably be updated to
the C++ replacements at some point. Additionally the C89 standard
library is available.

It can also be a non-trivial job to port some C89 programs to C99. I'm
in the process of modernizing my old text-adventure game, and one of
the tools I used was to run files through a C++ compiler. That
pinpointed all the implicit ints, undeclared functions, and K&R
function defintions that were still hanging around in the code.

It can also be fairly difficult to port from C to C++ (if that was
never the intention of the original authors).
I had a notion to try with PostgreSQL, but soon realized that hundreds
(thousands?) of hours were at stake and abandoned it.
We did the first (that I know of) port of PostgreSQL to Win32 several
years ago and we usually convert everything to C++ here, but that one
was a no-go.
The current version of PostgreSQL has some of our code in it.

.



Relevant Pages

  • ANNOUNCE: release 2 of DJGPP port of GNU debugger (GDB) 7.2 uploaded.
    ... This is a port of GNU debugger (GDB) 7.2 to MSDOS/DJGPP. ... DJGPP specific changes. ... This is necessary to be able to compile a GDB version with TUI support. ...
    (comp.os.msdos.djgpp)
  • ANNOUNCE: DJGPP port of FreeBE/AF 1.2 uploaded.
    ... This is a port of FreeBE/AF 1.2 to MSDOS/DJGPP. ... DJGPP specific changes. ... Please note that I have no hardware to test if the drivers really work. ... To compile this program the allegro library and certain ...
    (comp.os.msdos.djgpp)
  • ANNOUNCE: DJGPP port of GNU binutils 2.23.1 uploaded.
    ... This is a port of GNU binutils 2.23.1 to MSDOS/DJGPP. ... This port has a working> 64k relocation support. ... That script is very simple and will only work to configure and compile the ...
    (comp.os.msdos.djgpp)
  • Re: upgrage from 4.1.2 to 4.3.3+?
    ... > every available RPM for the distro...and there isn't one for PHP. ... > And also, I uh, don't believe I've ever recompiled Apache or PHP. ... Well - You could compile your own version of Apache and PHP and place it ... port number - By this I mean, whenever you visit a website, it defaults ...
    (comp.lang.php)
  • ANNOUNCE: DJGPP port of GNU debugger (GDB) 7.3.1 uploaded.
    ... This is a port of GNU debugger (GDB) 7.3.1 to MSDOS/DJGPP. ... This is necessary to be able to compile a GDB version with TUI support. ...
    (comp.os.msdos.djgpp)