public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/20323] New: optional arguments incorrectly accepted in specification expressions
@ 2005-03-04 19:57 tow21 at cam dot ac dot uk
  2005-03-09 16:01 ` [Bug fortran/20323] " Thomas dot Koenig at online dot de
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tow21 at cam dot ac dot uk @ 2005-03-04 19:57 UTC (permalink / raw)
  To: gcc-bugs

In the program below, the optional argument arg is used as part of the 
specification expression for the length of a string. This is forbidden by 
section 7.1.6.2; constraint (2) of the F95 standard (and wouldn't make 
much sense anyway - what happens when the function is called without the 
optional argument?) 
 
gfortran accepts it without complaint, though. 
 
parabrisas:~/test% cat testpresent.f90  
function testpresent(arg) 
   integer, intent(in), optional :: arg 
   character(len=arg) :: s 
   logical :: testpresent 
 
   testpresent=.true. 
 
end function testpresent 
parabrisas:~/test% gfortran -c testpresent.f90  
parabrisas:~/test% gfortran -v 
Using built-in specs. 
Configured with: ../gcc/configure --prefix=/home/tow/root/gcc-4.0 
--enable-languages=c,f95 : (reconfigured) ../gcc/configure 
--prefix=/home/tow/root/gcc-4.0 
--with-gcc-version-trigger=/home/tow/dl/gcc/gcc/gcc/version.c 
--enable-languages=c,f95 --no-create --no-recursion : 
(reconfigured) ../gcc/configure --prefix=/home/tow/root/gcc-4.0 
--with-gcc-version-trigger=/home/tow/dl/gcc/gcc/gcc/version.c 
--enable-languages=c,f95 --no-create --no-recursion 
Thread model: posix 
gcc version 4.0.0 20050127 (experimental)

-- 
           Summary: optional arguments incorrectly accepted in specification
                    expressions
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tow21 at cam dot ac dot uk
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-03-13 18:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-04 19:57 [Bug fortran/20323] New: optional arguments incorrectly accepted in specification expressions tow21 at cam dot ac dot uk
2005-03-09 16:01 ` [Bug fortran/20323] " Thomas dot Koenig at online dot de
2005-03-09 16:12 ` tow21 at cam dot ac dot uk
2005-03-12 23:37 ` tobi at gcc dot gnu dot org
2005-03-13 17:23 ` tobi at gcc dot gnu dot org
2005-03-13 18:37 ` cvs-commit at gcc dot gnu dot org
2005-03-13 18:40 ` cvs-commit at gcc dot gnu dot org
2005-03-13 18:42 ` tobi at gcc dot gnu dot org
2005-03-13 18:44 ` pinskia at gcc dot gnu dot 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).