The following is non-standard and the compiler should probably generate a warning/error with '-pedantic -std=f95' INTEGER, POINTER :: I REAL, POINTER :: A A=>NULL(I) END
Intel says "The type of the target is different from the pointer". Confirmed.
Are there any circumstances where the argument to NULL has any meaning, besides making a program invalid?
(In reply to comment #2) > Are there any circumstances where the argument to NULL has any meaning, besides > making a program invalid? PR21177
Subject: Bug 20858 Author: kargl Date: Fri Feb 10 19:01:05 2006 New Revision: 110845 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110845 Log: 2006-02-05 Steven G. Kargl <kargls@comcast.net> PR fortran/20858 *decl.c (variable_decl): Improve error message. Remove initialization typespec. Wrap long line. *expr.c (gfc_check_pointer_assign): Permit checking of type, kind type, and rank. *simplify.c (gfc_simplify_null): Ensure type, kind type, and rank are set. gfortran.dg/null_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/null_1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c trunk/gcc/fortran/expr.c trunk/gcc/fortran/simplify.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 20858 Author: kargl Date: Fri Feb 10 20:09:41 2006 New Revision: 110848 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110848 Log: 2006-02-10 Steven G. Kargl <kargls@comcast.net> PR fortran/20858 *decl.c (variable_decl): Improve error message. Remove initialization typespec. Wrap long line. *expr.c (gfc_check_pointer_assign): Permit checking of type, kind type, and rank. *simplify.c (gfc_simplify_null): Ensure type, kind type, and rank are set. 2006-02-10 Steven G. Kargl <kargls@comcast.net> PR fortran/20858 gfortran.dg/null_1.f90: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/null_1.f90 Modified: branches/gcc-4_1-branch/gcc/fortran/ChangeLog branches/gcc-4_1-branch/gcc/fortran/decl.c branches/gcc-4_1-branch/gcc/fortran/expr.c branches/gcc-4_1-branch/gcc/fortran/simplify.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed on 4.1 and trunk.