This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fortran-experiments: patch for error checking


hi all,

i've done some more work on the error checking to fix a bug pointed out by Tobias on the wiki. the bug deals with verifying the kind parameter for declarations that use the named constants from iso_c_binding. this verification was being done no matter whether the variable was bind(c) or not.

to fix this, verification of the kind parameter is now done during the verify_c_interop, since then we know the variable is either bind(c) or
part of something that is bind(c) (i.e., derived type, procedure,
common block). currently, an error is issued only if the named constant
from iso_c_binding used is for a different type than that of the variable
(e.g., integer(c_float)). if something else is used and interoperability
can't be confirmed, a warning is issued.


also, my name is misspelled in ChangeLog.isocbinding for my first entry on 2007-01-24.

ChangLog entry for this patch:

2007-01-25 Christopher D. Rickett <crickett@lanl.gov>
* gcc/testsuite/gfortran.dg/c_kind_tests_2.f03: New test case for
verifying C interoperable kinds for BIND(C) variables.
* gcc/testsuite/gfortran.dg/interop_params.f03: New test case for
verifying C interoperable kinds for dummy args to BIND(C)
routines.
* gcc/fortran/symbol.c: Modified call to verify_c_interop in
verify_bind_c_derived_type to give args for component name and
location.
* gcc/fortran/decl.c: Modified calls to verify_c_interop to give
args for symbol name and location. Slightly changed a couple
warning messages. Removed validation of C kind from
gfc_match_kind_spec. Added validation of C kind to
verify_c_interop. Removed the verification of C interoperability in
build_sym since it is done in variable_decl. Modified checks on
BIND(C) derived types to include errors for the definition and any
variable declared with it.
* gcc/fortran/gfortran.h: Changed the prototype for
verify_c_interop to take args for the symbol/component name and
location. These are used for an error message if the validation
of the C kind fails.



bootstrapped and regtested on x86 with no new failures. Chris

ps: is anyone tracking/updating the bugs listed for iso_c_binding on the wiki?

Attachment: svn_diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]