public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/107237] New: Error: non-constant array in DATA statement (1)
@ 2022-10-12 14:18 ptw at tpointsw dot uk
  2022-10-12 15:45 ` [Bug fortran/107237] " anlauf at gcc dot gnu.org
  2022-10-12 16:18 ` ptw at tpointsw dot uk
  0 siblings, 2 replies; 3+ messages in thread
From: ptw at tpointsw dot uk @ 2022-10-12 14:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107237

            Bug ID: 107237
           Summary: Error: non-constant array in DATA statement (1)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ptw at tpointsw dot uk
  Target Milestone: ---

Apologies if this report is incomplete or blemished. Hopefully the example is
sufficiently concise that the problem will be easy to reproduce.

Using gfortran under Windows 10, this apparently valid Fortran code:

      REAL A(4)
      DATA A(l), A(2), A(3), A(4) /0.0, 0.0, 0.0, 0.0/
      PRINT *, A(1)
      END

produces the reports:

       DATA A(l), A(2), A(3), A(4) /0.0, 0.0, 0.0, 0.0/
            1
Error: non-constant array in DATA statement (1)

       DATA A(l), A(2), A(3), A(4) /0.0, 0.0, 0.0, 0.0/
          1
Error: Data element below array lower bound at (1)

Output from gfortran -v is as follows:
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu
--host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw
--with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32
--with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada
--with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared
--enable-threads --with-dwarf2 --disable-sjlj-exceptions
--enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw
--with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic
--enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)

I get the same errors on a recently built Ubuntu platform.

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

* [Bug fortran/107237] Error: non-constant array in DATA statement (1)
  2022-10-12 14:18 [Bug fortran/107237] New: Error: non-constant array in DATA statement (1) ptw at tpointsw dot uk
@ 2022-10-12 15:45 ` anlauf at gcc dot gnu.org
  2022-10-12 16:18 ` ptw at tpointsw dot uk
  1 sibling, 0 replies; 3+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-10-12 15:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107237

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
                 CC|                            |anlauf at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from anlauf at gcc dot gnu.org ---
It would help if you chose a font that can distinguish 'l' (ell) from '1'
(one).

Adding "implicit none" of -fimplicit-none tells you:

    2 |       DATA A(l), A(2), A(3), A(4) /0.0, 0.0, 0.0, 0.0/
      |              1
Error: Symbol 'l' at (1) has no IMPLICIT type

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

* [Bug fortran/107237] Error: non-constant array in DATA statement (1)
  2022-10-12 14:18 [Bug fortran/107237] New: Error: non-constant array in DATA statement (1) ptw at tpointsw dot uk
  2022-10-12 15:45 ` [Bug fortran/107237] " anlauf at gcc dot gnu.org
@ 2022-10-12 16:18 ` ptw at tpointsw dot uk
  1 sibling, 0 replies; 3+ messages in thread
From: ptw at tpointsw dot uk @ 2022-10-12 16:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107237

--- Comment #2 from Patrick Wallace <ptw at tpointsw dot uk> ---
Many thanks for the quick response, and profound apologies for this red
herring. The reason I got caught out is that the code I started with had been
copy/pasted from a PDF, using Acrobat Reader. The latter is (to my surprise)
capable of performing character recognition on an image of the original printed
publication and had interpreted a decimal one as lowercase lima.  BTW my own
code invariably starts with IMPLICIT NONE and I wish I had tried this in the
example!

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

end of thread, other threads:[~2022-10-12 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12 14:18 [Bug fortran/107237] New: Error: non-constant array in DATA statement (1) ptw at tpointsw dot uk
2022-10-12 15:45 ` [Bug fortran/107237] " anlauf at gcc dot gnu.org
2022-10-12 16:18 ` ptw at tpointsw dot uk

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).