using std::FILE

Steve M. Robbins steve at
Mon Dec 17 16:18:13 CET 2007

Hi Folks,

On Mon, Dec 17, 2007 at 11:10:39AM +0100, Marc Glisse wrote:
> On Sun, 16 Dec 2007, Richard B. Kreckel wrote:

> > Apparently, the intent is to avoid including stdio.h or cstdio. Why? I
> > would suggest including it.
> I think it is because stdio is not present on all targets supported by 
> gmp, and even when it is it uselessly (when you don't use it) makes the 
> whole program more heavy. I agree this last is not very relevant for a 
> shared libgmp linked to a shared libc (or usually for C++).

There is another solution that addresses this goal: move the
FILE-using declarations out of gmp.h into a new header (e.g. gmpio.h)
that unconditionally includes stdio.h or cstdio.  This solution also
removes the burden of remembering the header dependency -- i.e.
include stdio before gmp.h.

It does have the large disadvantage of breaking backwards
compatibility, I admit.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : 

More information about the gmp-bugs mailing list