stdio.h

Vincent Lefevre vincent at vinc17.net
Mon Aug 22 14:37:11 CEST 2022


On 2022-08-22 14:17:08 +0200, Paul Zimmermann wrote:
>        Hi,
> 
> the fine manual says:
> 
>    All declarations needed to use GMP are collected in the include file
>    'gmp.h'.  It is designed to work with both C and C++ compilers.
> 
> 	#include <gmp.h>
> 
>       Note however that prototypes for GMP functions with 'FILE *'
>    parameters are only provided if '<stdio.h>' is included too.
> 
> 	#include <stdio.h>
> 	#include <gmp.h>
> 
> What is the reason why <stdio.h> is not included by default?

I suppose that it may not be provided everywhere, e.g. on some
freestanding implementations (if supported by GMP).

Even on desktop machines, if libc6-dev is not installed:
  https://stackoverflow.com/questions/19580758/gcc-fatal-error-stdio-h-no-such-file-or-directory

BTW, in Debian, libgmp-dev doesn't depend on libc6-dev.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-devel mailing list