From: Thomas Koenig Date: Fri, 3 Jan 2025 17:31:07 +0000 (+0100) Subject: Mention generating C prototypes in the C interop documentation. X-Git-Tag: basepoints/gcc-16~3003 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=92ad6d4ebfe5454b9299f295926517bd453bc4a2;p=thirdparty%2Fgcc.git Mention generating C prototypes in the C interop documentation. gcc/fortran/ChangeLog: * gfortran.texi: New subsection "Generating C prototypes from Fortran". --- diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index 430ede45ea1b..116667245932 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -2918,6 +2918,7 @@ C or some other language instead of Fortran, see * Interoperable Subroutines and Functions:: * Working with C Pointers:: * Further Interoperability of Fortran with C:: +* Generating C prototypes from Fortran:: @end menu Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a @@ -3322,6 +3323,20 @@ are converted to the specified form. If you need to access GNU Fortran's internal array descriptor, you can use the Chasm Language Interoperability Tools, @url{http://chasm-interop.sourceforge.net/}. +@node Generating C prototypes from Fortran +@subsection Generating C prototypes from Fortran +@cindex prototypes +@cindex C prototypes +The options @option{-fc-prototypes} can be used to write out C +declatations and function prototypes for @code{BIND(C)} entities. +The same can be done for writing out prototypes for external +procedures using @option{-fc-prototypes-external}, +@pxref{Interoperability Options}. + +Standard Fortran does not specify an interoperable type for C's +@code{unsigned} integer types. For interoperability with unsigned +types, GNU Fortran provides unsigned integers, @pxref{Unsigned integers}. + @node GNU Fortran Compiler Directives @section GNU Fortran Compiler Directives @cindex GNU Fortran Compiler Directives