https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61180
Dominique d'Humieres <dominiq at lps dot ens.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2014-05-13 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- (1) The warnings appear also with -Wall (without -Wsurprising). (2) The code crashes at run time, i.e., the code is likely wrong (as suggested by the warnings). (3) With the following variant USE M1 TYPE(foo_type) :: foo INTEGER, DIMENSION(:), ALLOCATABLE :: data1 INTEGER, DIMENSION(:), POINTER :: data2 INTEGER, DIMENSION(:), POINTER :: data3 ALLOCATE(data1(10)) ALLOCATE(data2(10)) ALLOCATE(foo%data(10)) foo%data=1 ! no warning needed...pointer assignment not possible ! data1=get_data(foo) ! no warning needed...pointer assignment not intended data2(3:)=>get_data(foo) ! warning possible, but not documented on ! gfortran/Error-and-Warning-Options.html#Error-and-Warning-Options data3=>get_data(foo) print *, data2(12) print *, data3(10) END PROGRAM the code compiles and prints 1 twice at run time. Why do you think the warnings are not needed?