bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] Re: avoid using casts whenever possible [Re: gnulib/lib


From: Paul Eggert
Subject: Re: [Bug-gnulib] Re: avoid using casts whenever possible [Re: gnulib/lib error.c
Date: 30 Sep 2003 12:23:59 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Bruno Haible <address@hidden> writes:

> the .h header files need to be usable from within C++, otherwise
> things like Windows DLLs become much harder to use.

I don't use Windows DLLs, so I don't know the constraints here.

Isn't extern "C" the normal way to tell a C++ compiler that it is
compiling C code?  If we put

#ifdef __cplusplus__
extern "C" {
#endif

in gnulib headers, would that solve your problems with Windows DLLs?
(I'm not sure I'd favor such a change, but I still don't know what the
problem really is.)


> I'm not using XMALLOC myself either, currently, because I believe that
> even with hand-written casts I don't make terrible mistakes. But it is
> Jim's and your argument that as few hand-maintained casts as possible
> is best, to reduce the opportunities for wrong casts; and therefore my
> plea to keep this macro in its useful form.

Since neither you nor I are fans of XMALLOC, perhaps we're not the
best to decide this....

coreutils, m4, and a2ps use it; I don't know of any other users.
I will write proposed patches that remove those uses of the macros.
If these patches are accepted, we can remove those macros.
If not, we can consult with the remaining users of the macros to see
what they prefer.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]