bug-gnulib
[Top][All Lists]
Advanced

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

Re: make safe_read usable in a mixed C/C++ build


From: Lorenzo Bettini
Subject: Re: make safe_read usable in a mixed C/C++ build
Date: Thu, 04 Jan 2007 10:36:37 +0100
User-agent: Icedove 1.5.0.9 (X11/20061220)

Bruno Haible wrote:
> Eric Blake asked:
>> Is it also necessary to wrap safe-read.c with extern "C", for use when
>> using g++ as a type-safe variant of a C compiler, to match the header?
> 
> Normally not. The 'extern "C"' is only needed in mixed C/C++ builds.
> 
>> And should you be symmetric with safe-write.h?
> 
> I deal with these issues on a case-by-case basis. But if you want to add
> extern "C" to all gnulib .h files at once, I have no objection.
> 

I raised this issue too, concerning strdup.h (and you already added
extern "C").

Probably it wouldn't be bad to always have extern "C" in all gnulib
headers since it would made them all usable in C++ programs too...
probably I'm biased though, since I prefer coding in C++ ;-)

however, this is also what the C/C++ library does, doesn't it?

Lorenzo

-- 
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net




reply via email to

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