using std::FILE

Christopher Creutzig ccr at
Wed Dec 19 10:58:17 CET 2007

Richard B. Kreckel wrote:

> right. And if the next developer walks up and observes that <gmp.h> and 
> <stdio.h> do not commute (as any sane header files should), you can help 

 Actually, this is the core of the problem, in my opinion. Leaving aside
C++, g++'s deviations from the standard etc., the effect of

#include <stdio.h>
#include <gmp.h>


#include <gmp.h>
#include <stdio.h>

is different from one another, and both are legal. Personally, I regard
that as a design bug, a problem waiting to bite the next unsuspecting
developer. (Also note that the problem may be even worse: In the situation

#include "foo.h"
// ...
#include <gmp.h>
// ...
#include <stdio.h>

a change in some very remote place, foo.h or one of the files included
there, can break the code.) I'd strongly suggest moving the relevant
parts into a separate header instead of relying on some other header
defining one of fourteen(!) include guards, internal macros etc.
encountered so far. Just my €0.02.

SciFace Software GmbH & Co. KG
    Technologiepark 11    Tel: ++49 (0)5251 1843000
    D-33100 Paderborn     Fax: ++49 (0)5251 1843010
    Deutschland           Web:
Sitz der Gesellschaft: Paderborn
    Registergericht Paderborn HRA 2080
    Ust.-ID Nr.: DE 187992139
Persönlich haftende Gesellschaft:
    SciFace Software Verwaltungsgesellschaft mbH
    Registergericht Paderborn HRB 2924
    Geschäftsführer: Dr. Oliver Kluge

More information about the gmp-bugs mailing list