This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Linux vs. libio
- To: Per Bothner <per at bothner dot com>
- Subject: Re: Linux vs. libio
- From: Kevin Atkinson <kevinatk at home dot com>
- Date: Mon, 20 Dec 1999 15:00:28 -0500
- CC: Joern Rennecke <amylaar at cygnus dot co dot uk>, gcc at gcc dot gnu dot org, libc-alpha at sourceware dot cygnus dot com
- References: <199912201906.TAA05714@phal.cygnus.co.uk> <m2emchza2i.fsf@magnus.bothner.com>
Per Bothner wrote:
> Duh. libio defines some *C++* classes, whose specification
> was (partially) specified by existing (de facto) standards.
> Using plain C misses the point. Libio was written to facilitate
> integration of C and C++ I/O, which is *required* by the C++ standard.
>
> There is (as always) a design tradeoff. As I see it,
> unified C/C++ I/O gives us:
> + Improved performance.
> + Conceptual elegance of uniting the I/O facilities of C/C++.
> + Easier mixing of C and C++ code (a GNU extension).
> + Sharing some tricky code (e.g. buffer management).
>
> On the other hand, it costs us:
> - Extra "hair".
> - Compatibility issues made more complicated when two ABIs
> depend so closely on each other.
Maybe I am missing something but couldn't the io code in linux be
written in pure C with a few extensions to allow C++ wrapper classes to
effectively use the io services. Like say provide inline functions (or
macros) to manipulate the buffer efficiently.
--
Kevin Atkinson
kevinatk@home.com
http://metalab.unc.edu/kevina/