public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49111] New: Unnecessary warning for private interfaces having the BIND(C) attribute
@ 2011-05-22 16:03 jwmwalrus at gmail dot com
  2011-05-22 16:35 ` [Bug fortran/49111] " jwmwalrus at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jwmwalrus at gmail dot com @ 2011-05-22 16:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49111

           Summary: Unnecessary warning for private interfaces having the
                    BIND(C) attribute
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jwmwalrus@gmail.com


When the following module:

module mod1
    use iso_c_binding
    implicit none
    save

    interface
        function strerror(errnum) bind(C, NAME = 'strerror')
            import
            type(C_PTR) :: strerror
            integer(C_INT), value :: errnum
        end function
    end interface

    private strerror
end module mod1


gfortran warns about the private symbol 'strerror' being given a binding label.
 The exact warning is:

...:~$ gfortran -c  test_gfortran_private_cbinding.f90 
test_gfortran_private_cbinding.f90:8.8:

        function strerror(errnum) bind(C, NAME = 'strerror')
        1
Warning: Symbol 'strerror' at (1) is marked PRIVATE but has been given the
binding label 'strerror'


In sections 5.3.2 and 5.3.5 of the Fortran 2008 standard, there seems to be no
restriction between the BIND and PRIVATE attributes ---i.e., the BIND(C)
attribute is compatible with the PRIVATE attribute, and therefore no warning
should be issued by the gfortran.


The version information is:

...:~$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.6.0-3~ppa1'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-multiarch
--with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib/x86_64-linux-gnu
--enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror
--with-arch-32=i686 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 20110409 (prerelease) (Ubuntu 4.6.0-3~ppa1) 


The system information (for Ubuntu 11.04) is:

...:~$ uname -srvmpio
Linux 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64
x86_64 x86_64 GNU/Linux


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-24 23:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-22 16:03 [Bug fortran/49111] New: Unnecessary warning for private interfaces having the BIND(C) attribute jwmwalrus at gmail dot com
2011-05-22 16:35 ` [Bug fortran/49111] " jwmwalrus at gmail dot com
2011-05-22 17:31 ` burnus at gcc dot gnu.org
2012-10-12 20:54 ` craig.powers at gmail dot com
2013-12-29 13:08 ` dominiq at lps dot ens.fr
2021-10-24 23:46 ` sandra at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).