public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "thomas dot orgis at awi dot de" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/35381] Misleading error message with derived types: Exponent at (1) must be INTEGER for an initialization expression Date: Tue, 26 Feb 2008 17:38:00 -0000 [thread overview] Message-ID: <20080226173716.14667.qmail@sourceware.org> (raw) In-Reply-To: <bug-35381-15830@http.gcc.gnu.org/bugzilla/> ------- Comment #1 from thomas dot orgis at awi dot de 2008-02-26 17:37 ------- I stripped a bit more and I think I got the root of the problem, illustrated by this more minimal example: MODULE data IMPLICIT NONE PRIVATE INTEGER, PARAMETER :: dat_dimension = 2 TYPE dat_sigtype real(kind=4) :: gamma END TYPE dat_sigtype TYPE(dat_sigtype), PARAMETER :: dat_sig = dat_sigtype( 1.3_4 ) real(kind=4), PARAMETER :: expo = 1.3_4 real(kind=4), PARAMETER :: rconst = 2._4**dat_sig%gamma real(kind=4), PARAMETER :: rconst2 = 2._4**expo CONTAINS END MODULE data ...and these gcc messages: In file baddata.f90:11 TYPE(dat_sigtype), PARAMETER :: dat_sig = dat_sigtype( 1.3_4 ) 1 Error: Exponent at (1) must be INTEGER for an initialization expression In file baddata.f90:16 real(kind=4), PARAMETER :: rconst2 = 2._4**expo 1 Error: Exponent at (1) must be INTEGER for an initialization expression So we are dealing with a limitation (in accordance to F95 standard, as I read... and thus correct here) with initialization. The problem I still have with gcc here is that when the exponent comes from a derived type, the error message points to the exponents definition (which is correct code) and not the the bad initialization code (which is not correct code). -- thomas dot orgis at awi dot de changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Real initialization problem |Misleading error message |(invalid error): Exponent at|with derived types: Exponent |(1) must be INTEGER for an |at (1) must be INTEGER for |initialization expression |an initialization expression http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35381
next prev parent reply other threads:[~2008-02-26 17:38 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-02-26 17:20 [Bug fortran/35381] New: Real initialization problem (invalid error): " thomas dot orgis at awi dot de 2008-02-26 17:38 ` thomas dot orgis at awi dot de [this message] 2008-02-27 2:14 ` [Bug fortran/35381] Misleading error message with derived types: " jvdelisle at gcc dot gnu dot org 2008-02-27 10:13 ` thomas dot orgis at awi dot de 2008-02-28 5:00 ` jvdelisle at gcc dot gnu dot org 2008-02-28 10:11 ` fxcoudert at gcc dot gnu dot org 2008-02-28 10:41 ` thomas dot orgis at awi dot de
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20080226173716.14667.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).