gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1516 Posts in 502 Topics by 733 Members - Latest Member: tbickel3 October 29, 2020, 12:28:00 AM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  General  |  ARRAY BOUNDARY CHECK AND USE OF STRUCTURES
gfx
gfxgfx
 

Author Topic: ARRAY BOUNDARY CHECK AND USE OF STRUCTURES  (Read 2806 times)

Mark Coxhead

  • Jr. Member
  • **
  • Posts: 82
ARRAY BOUNDARY CHECK AND USE OF STRUCTURES
« on: November 11, 2014, 07:58:46 AM »
ARRAY BOUNDARY CHECK AND USE OF STRUCTURES

I noticed the recent post on ARRAY BOUNDARY CHECKER in the WINDOWS section.

I have found this switch useful in the past as having this set can detect a lot of unforeseen compile and mostly run-time errors.

However there is one system with this switched I encounter the following  array boundary error, when it is not.

I have a structure defined as follows:
RECORD /SCHED_HEADINGS/ CREC

STRUCTURE /SCHED_HEADINGS/
      CHARACTER*74     TS_HEAD
      RECORD /DS_HEAD/ DUTYSCHED(4)
END STRUCTURE

STRUCTURE /DS_HEAD/
    CHARACTER *2   GARCODE
   CHARACTER *14   GARNAME
END STRUCTURE



When I run the suite of programs, one sub-routine errors with the following message:

     Subscript 10214400 is out of range for dimension 1 for array ? DUTYSCHED with bounds 1:4
or

     Subscript < space>  is out of range for dimension 1 for array ? DUTYSCHED with bounds 1:4


The offending line of code is
WRITE (PTRP_LUN) CREC   

Values to DUTYSHED(n) are created prior as
            CREC.DUTYSCHED(I).GARCODE = GARCODE etc    (where I =  1,4)
Without the array boundary error switch on this code has worked for about ten years without issue.  Is there a workaround please?

mecej4

  • Jr. Member
  • **
  • Posts: 66
Re: ARRAY BOUNDARY CHECK AND USE OF STRUCTURES
« Reply #1 on: November 12, 2014, 07:28:20 AM »
It is not uncommon for a program to issue false array bounds error reports when several checks have been switched on, and more so when parts of the program have been compiled with different checking options.

Can you post a reproducer?

RECORD and STRUCTURE are older Fortran 77 extensions that are superseded by other facilities in Fortran 90 and later.

Absoft User Forum  |  Support  |  General  |  ARRAY BOUNDARY CHECK AND USE OF STRUCTURES
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!