- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Dear all,
When running the example below (compiled with the -check all) I would have expected to get a runtime error because of the out of bounds assignment. This does not happen. How can I get this error or is this a bug in the compiler (I use 9.1 but it is also present in 10.1).
Best regards,
Albert
PROGRAM tst
DOUBLE PRECISION, POINTER :: a(:)
DOUBLE PRECISION, POINTER :: b(:)
DOUBLE PRECISION, POINTER :: c(:)
DOUBLE PRECISION, POINTER :: e(:)
INTEGER:: i
allocate(a(10000))
allocate(b(10000))
allocate(c(10000))
e => b(15000:15000)
;
do i = 1,1
e(i) = i
enddo
write(*,*) sum(a), sum(b), sum(c), sum(e)
end PROGRAM
When running the example below (compiled with the -check all) I would have expected to get a runtime error because of the out of bounds assignment. This does not happen. How can I get this error or is this a bug in the compiler (I use 9.1 but it is also present in 10.1).
Best regards,
Albert
PROGRAM tst
DOUBLE PRECISION, POINTER :: a(:)
DOUBLE PRECISION, POINTER :: b(:)
DOUBLE PRECISION, POINTER :: c(:)
DOUBLE PRECISION, POINTER :: e(:)
INTEGER:: i
allocate(a(10000))
allocate(b(10000))
allocate(c(10000))
e => b(15000:15000)
;
do i = 1,1
e(i) = i
enddo
write(*,*) sum(a), sum(b), sum(c), sum(e)
end PROGRAM
Link kopiert
2 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Albert,
Our compiler does not currently notice the problem with the pointer assignment - that's where it would have to catch this. Our normal bounds checking looks only at array (and string) references, and the references within the loop of E are all within the bounds of E. That E points to invalid storage is a separate issue.
I will pass your comments on to the developers as a feature request.
Our compiler does not currently notice the problem with the pointer assignment - that's where it would have to catch this. Our normal bounds checking looks only at array (and string) references, and the references within the loop of E are all within the bounds of E. That E points to invalid storage is a separate issue.
I will pass your comments on to the developers as a feature request.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
MADsblionel:
I will pass your comments on to the developers as a feature request.
Much appreciated,
Albert

Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite