From patchwork Thu Feb 21 09:27:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 222221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 4BEB72C007C for ; Thu, 21 Feb 2013 20:28:02 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1362043683; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=p90HdLe J7NUg/p9UMM6MUKKLIec=; b=v2Llexk+AffQwUBW/YaWtzjXkb0PXo+r3n3rLPq A6rIM0W00aCpZXx7EcJjsi5S1jaffeIG3ow6iaxniaoz1F7WX5zj91lbU3orWYoh b9ToVQ6BF+yqBvfLy8OVIyrSMG0DNWB741GMKN67kJKU+3TOSjfNHA2XSvlOYKOt LCOc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=bn1s23GC9Nr0BBMSd747mi2lSMNn6KM+DLkbtnxWmMnzZ4Sc8L43QL5meCX0je 1wSeRwvMYaMW4RHQUJrLE+S60GSE9OAUF/wf3aWHQIt0JjKG82c7B8uUiPBIC2it 2XfNBKEqUbq6GvFjX4lyPZEjfSDohYHLpk8WrZ7SHi2uk=; Received: (qmail 30355 invoked by alias); 21 Feb 2013 09:27:43 -0000 Received: (qmail 30337 invoked by uid 22791); 21 Feb 2013 09:27:39 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx02.qsc.de (HELO mx02.qsc.de) (213.148.130.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Feb 2013 09:27:28 +0000 Received: from archimedes.net-b.de (port-92-195-67-77.dynamic.qsc.de [92.195.67.77]) by mx02.qsc.de (Postfix) with ESMTP id 4CBAE2434C; Thu, 21 Feb 2013 10:27:26 +0100 (CET) Message-ID: <5125E87E.5030809@net-b.de> Date: Thu, 21 Feb 2013 10:27:26 +0100 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran, committed] PR56416 - Fix texinfo 5.0 warnings Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Motivated by Jakub's email at http://gcc.gnu.org/ml/gcc-patches/2013-02/msg00966.html The problem was that the order in @menu didn't match the order of the @node (@section/@chapter). I have committed the attached patch as obvious (Rev. 196194). fortran/*.texi is now warning free for "make info" and "make html". ("make pdf" still shows the usual TeX warnings about overfull boxes and similar.) Tobias 2012-02-21 Tobias Burnus PR fortran/56416 * gfortran.texi (Part II: Language Reference, Extensions, Non-Fortran Main Program): Sort @menu to match actual section order. * intrinsic.texi (Intrinsic Procedures): Ditto. (C_F_POINTER, PRECISION): Move to the alphabetically correct place. diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index 2dccb16..462b443 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -182,8 +182,8 @@ Part I: Invoking GNU Fortran Part II: Language Reference * Fortran 2003 and 2008 status:: Fortran 2003 and 2008 features supported by GNU Fortran. * Compiler Characteristics:: User-visible implementation details. +* Extensions:: Language extensions implemented by GNU Fortran. * Mixed-Language Programming:: Interoperability with C -* Extensions:: Language extensions implemented by GNU Fortran. * Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran. * Intrinsic Modules:: Intrinsic modules supported by GNU Fortran. @@ -1348,8 +1348,8 @@ without warning. * Commas in FORMAT specifications:: * Missing period in FORMAT specifications:: * I/O item lists:: -* BOZ literal constants:: * @code{Q} exponent-letter:: +* BOZ literal constants:: * Real array indices:: * Unary operators:: * Implicitly convert LOGICAL and INTEGER values:: @@ -2698,8 +2698,8 @@ the same declaration part as the variable or procedure pointer. * _gfortran_set_options:: Set library option flags * _gfortran_set_convert:: Set endian conversion * _gfortran_set_record_marker:: Set length of record markers -* _gfortran_set_max_subrecord_length:: Set subrecord length * _gfortran_set_fpe:: Set when a Floating Point Exception should be raised +* _gfortran_set_max_subrecord_length:: Set subrecord length @end menu Even if you are doing mixed-language programming, it is very diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index 91f2fea..4a48425 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -87,9 +87,9 @@ Some basic guidelines for editing this document: * @code{CHMOD}: CHMOD, Change access permissions of files * @code{CMPLX}: CMPLX, Complex conversion function * @code{COMMAND_ARGUMENT_COUNT}: COMMAND_ARGUMENT_COUNT, Get number of command line arguments -* @code{COMPLEX}: COMPLEX, Complex conversion function -* @code{COMPILER_VERSION}: COMPILER_VERSION, Compiler version string * @code{COMPILER_OPTIONS}: COMPILER_OPTIONS, Options passed to the compiler +* @code{COMPILER_VERSION}: COMPILER_VERSION, Compiler version string +* @code{COMPLEX}: COMPLEX, Complex conversion function * @code{CONJG}: CONJG, Complex conjugate function * @code{COS}: COS, Cosine function * @code{COSH}: COSH, Hyperbolic cosine function @@ -234,12 +234,12 @@ Some basic guidelines for editing this document: * @code{PRESENT}: PRESENT, Determine whether an optional dummy argument is specified * @code{PRODUCT}: PRODUCT, Product of array elements * @code{RADIX}: RADIX, Base of a data model +* @code{RAN}: RAN, Real pseudo-random number +* @code{RAND}: RAND, Real pseudo-random number * @code{RANDOM_NUMBER}: RANDOM_NUMBER, Pseudo-random number * @code{RANDOM_SEED}: RANDOM_SEED, Initialize a pseudo-random number sequence -* @code{RAND}: RAND, Real pseudo-random number * @code{RANGE}: RANGE, Decimal exponent range * @code{RANK} : RANK, Rank of a data object -* @code{RAN}: RAN, Real pseudo-random number * @code{REAL}: REAL, Convert to real type * @code{RENAME}: RENAME, Rename a file * @code{REPEAT}: REPEAT, Repeated string concatenation @@ -2271,60 +2271,57 @@ end subroutine association_test @end table -@node C_FUNLOC -@section @code{C_FUNLOC} --- Obtain the C address of a procedure -@fnindex C_FUNLOC -@cindex pointer, C address of procedures +@node C_F_POINTER +@section @code{C_F_POINTER} --- Convert C into Fortran pointer +@fnindex C_F_POINTER +@cindex pointer, convert C to Fortran @table @asis @item @emph{Description}: -@code{C_FUNLOC(x)} determines the C address of the argument. +@code{C_F_POINTER(CPTR, FPTR[, SHAPE])} assigns the target of the C pointer +@var{CPTR} to the Fortran pointer @var{FPTR} and specifies its shape. @item @emph{Standard}: Fortran 2003 and later @item @emph{Class}: -Inquiry function +Subroutine @item @emph{Syntax}: -@code{RESULT = C_FUNLOC(x)} +@code{CALL C_F_POINTER(CPTR, FPTR[, SHAPE])} @item @emph{Arguments}: @multitable @columnfractions .15 .70 -@item @var{x} @tab Interoperable function or pointer to such function. +@item @var{CPTR} @tab scalar of the type @code{C_PTR}. It is +@code{INTENT(IN)}. +@item @var{FPTR} @tab pointer interoperable with @var{cptr}. It is +@code{INTENT(OUT)}. +@item @var{SHAPE} @tab (Optional) Rank-one array of type @code{INTEGER} +with @code{INTENT(IN)}. It shall be present +if and only if @var{fptr} is an array. The size +must be equal to the rank of @var{fptr}. @end multitable -@item @emph{Return value}: -The return value is of type @code{C_FUNPTR} and contains the C address -of the argument. - @item @emph{Example}: @smallexample -module x - use iso_c_binding - implicit none -contains - subroutine sub(a) bind(c) - real(c_float) :: a - a = sqrt(a)+5.0 - end subroutine sub -end module x program main use iso_c_binding - use x implicit none interface subroutine my_routine(p) bind(c,name='myC_func') - import :: c_funptr - type(c_funptr), intent(in) :: p + import :: c_ptr + type(c_ptr), intent(out) :: p end subroutine end interface - call my_routine(c_funloc(sub)) + type(c_ptr) :: cptr + real,pointer :: a(:) + call my_routine(cptr) + call c_f_pointer(cptr, a, [12]) end program main @end smallexample @item @emph{See also}: -@ref{C_ASSOCIATED}, @ref{C_LOC}, @ref{C_F_POINTER}, @ref{C_F_PROCPOINTER} +@ref{C_LOC}, @ref{C_F_PROCPOINTER} @end table @@ -2385,57 +2382,60 @@ end program main @end table -@node C_F_POINTER -@section @code{C_F_POINTER} --- Convert C into Fortran pointer -@fnindex C_F_POINTER -@cindex pointer, convert C to Fortran +@node C_FUNLOC +@section @code{C_FUNLOC} --- Obtain the C address of a procedure +@fnindex C_FUNLOC +@cindex pointer, C address of procedures @table @asis @item @emph{Description}: -@code{C_F_POINTER(CPTR, FPTR[, SHAPE])} assigns the target of the C pointer -@var{CPTR} to the Fortran pointer @var{FPTR} and specifies its shape. +@code{C_FUNLOC(x)} determines the C address of the argument. @item @emph{Standard}: Fortran 2003 and later @item @emph{Class}: -Subroutine +Inquiry function @item @emph{Syntax}: -@code{CALL C_F_POINTER(CPTR, FPTR[, SHAPE])} +@code{RESULT = C_FUNLOC(x)} @item @emph{Arguments}: @multitable @columnfractions .15 .70 -@item @var{CPTR} @tab scalar of the type @code{C_PTR}. It is -@code{INTENT(IN)}. -@item @var{FPTR} @tab pointer interoperable with @var{cptr}. It is -@code{INTENT(OUT)}. -@item @var{SHAPE} @tab (Optional) Rank-one array of type @code{INTEGER} -with @code{INTENT(IN)}. It shall be present -if and only if @var{fptr} is an array. The size -must be equal to the rank of @var{fptr}. +@item @var{x} @tab Interoperable function or pointer to such function. @end multitable +@item @emph{Return value}: +The return value is of type @code{C_FUNPTR} and contains the C address +of the argument. + @item @emph{Example}: @smallexample +module x + use iso_c_binding + implicit none +contains + subroutine sub(a) bind(c) + real(c_float) :: a + a = sqrt(a)+5.0 + end subroutine sub +end module x program main use iso_c_binding + use x implicit none interface subroutine my_routine(p) bind(c,name='myC_func') - import :: c_ptr - type(c_ptr), intent(out) :: p + import :: c_funptr + type(c_funptr), intent(in) :: p end subroutine end interface - type(c_ptr) :: cptr - real,pointer :: a(:) - call my_routine(cptr) - call c_f_pointer(cptr, a, [12]) + call my_routine(c_funloc(sub)) end program main @end smallexample @item @emph{See also}: -@ref{C_LOC}, @ref{C_F_PROCPOINTER} +@ref{C_ASSOCIATED}, @ref{C_LOC}, @ref{C_F_POINTER}, @ref{C_F_PROCPOINTER} @end table @@ -9749,51 +9749,6 @@ default kind. -@node PRECISION -@section @code{PRECISION} --- Decimal precision of a real kind -@fnindex PRECISION -@cindex model representation, precision - -@table @asis -@item @emph{Description}: -@code{PRECISION(X)} returns the decimal precision in the model of the -type of @code{X}. - -@item @emph{Standard}: -Fortran 95 and later - -@item @emph{Class}: -Inquiry function - -@item @emph{Syntax}: -@code{RESULT = PRECISION(X)} - -@item @emph{Arguments}: -@multitable @columnfractions .15 .70 -@item @var{X} @tab Shall be of type @code{REAL} or @code{COMPLEX}. -@end multitable - -@item @emph{Return value}: -The return value is of type @code{INTEGER} and of the default integer -kind. - -@item @emph{See also}: -@ref{SELECTED_REAL_KIND}, @ref{RANGE} - -@item @emph{Example}: -@smallexample -program prec_and_range - real(kind=4) :: x(2) - complex(kind=8) :: y - - print *, precision(x), range(x) - print *, precision(y), range(y) -end program prec_and_range -@end smallexample -@end table - - - @node POPCNT @section @code{POPCNT} --- Number of bits set @fnindex POPCNT @@ -9883,6 +9838,51 @@ end program test_population +@node PRECISION +@section @code{PRECISION} --- Decimal precision of a real kind +@fnindex PRECISION +@cindex model representation, precision + +@table @asis +@item @emph{Description}: +@code{PRECISION(X)} returns the decimal precision in the model of the +type of @code{X}. + +@item @emph{Standard}: +Fortran 95 and later + +@item @emph{Class}: +Inquiry function + +@item @emph{Syntax}: +@code{RESULT = PRECISION(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{X} @tab Shall be of type @code{REAL} or @code{COMPLEX}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{INTEGER} and of the default integer +kind. + +@item @emph{See also}: +@ref{SELECTED_REAL_KIND}, @ref{RANGE} + +@item @emph{Example}: +@smallexample +program prec_and_range + real(kind=4) :: x(2) + complex(kind=8) :: y + + print *, precision(x), range(x) + print *, precision(y), range(y) +end program prec_and_range +@end smallexample +@end table + + + @node PRESENT @section @code{PRESENT} --- Determine whether an optional dummy argument is specified @fnindex PRESENT