[Bug fortran/20520] allocatable arrays used without being allocated without a warning
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-17 17:37 --- Confirmed, but this is valid code (yes undefined). Even ICC 8.1 accepts the code without warnings or errors. -- What|Removed |Added Severity|normal |enhancement Status|UNCONFIRMED |NEW Ever Confirmed||1 Keywords||diagnostic Last reconfirmed|-00-00 00:00:00 |2005-03-17 17:37:26 date|| Summary|allocatable arrays may be |allocatable arrays used |used without being allocated|without being allocated ||without a warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20520
[Bug fortran/20520] allocatable arrays used without being allocated without a warning
--- Additional Comments From ebertakis at gmail dot com 2005-03-17 19:07 --- (In reply to comment #1) I tried it in Compaq Visual Fortran Professional Edition 6.5 and indeed the compiler accepts the code. The debugger though will display an error message indicating the line a(1)=2*b(1) and saying that the array bounds were exceeded. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20520
[Bug fortran/20520] allocatable arrays used without being allocated without a warning
--- Additional Comments From kargl at gcc dot gnu dot org 2005-03-17 19:46 --- www.lahey.com also compiles the code. It does issues 2 warnings about using an unitialized variable and a variable set bu never used. As Andrew said, you are in the area of undefined behavior, which means a compiler can do anything wants. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20520