[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regex & g++
From: |
Paul Eggert |
Subject: |
Re: regex & g++ |
Date: |
Tue, 23 Aug 2005 13:35:05 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Sam Steingold <address@hidden> writes:
> c++ is stricter, so if the code can be compiled with c++ it is probably
> safer.
That doesn't match my experience. To make C code work with C++, I
often have to introduce casts (e.g., to convert void * to char *, or
to convert one integer type to another). These casts reduce
reliability, since they can mask real problems when they are done
incorrectly. As a general rule I therefore prefer C code to have as
few casts as C allows.
I don't use C++, so I'll need your help here. Is there some simple
way that we can work around this in the regex code, without having to
make wholesale changes? For example, can we surround all the code
with extern "C" { ... } when compiling with C++?