This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Disallow checking for upper case characters in gfc_match
- From: Daniel Kraft <d at domob dot eu>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 24 Jul 2008 18:11:59 +0200
- Subject: Re: Disallow checking for upper case characters in gfc_match
- References: <488899BD.2010404@domob.eu> <4888A60E.1000001@net-b.de>
Tobias Burnus wrote:
Daniel Kraft wrote:
while working on parsing of typebound-procedures I just spent some
time puzzling over why
gfc_match (" PASS")
What do you think about the attached patch to add an additional
"sanity check" to gfc_match resulting in an ICE if a literal character
is upper-case? This is very simple, has not much potential to break
anything and would have saved me some time if it were already there.
I think it is ok to add a check, however, as match is quite often called
and the chance is quite low that this happens:
How about using gcc_assert instead? The result is the same (except that
the error message is not as clear) and it is not checked when
ENABLE_RUNTIME_CHECKING is disabled. I think it is unlikely to occur in
user code, where a better error message is helpful.
That's right! I thought about it being time-consuming, but I didn't
think it would be really noticable... But anyway, gcc_assert is better!
Ok to commit with an appropriate ChangeLog entry? Regression testing
running on GNU/Linux-x86-32.
Thus: OK to add a gcc_assert.
Thanks, committed with assertion as rev 138120.
Daniel
PS: Please CC patches to gcc-patches@.
I thought that was rather a nit and thus didn't want to post there. But
I'll post everything there in the future ;)
--
Done: Arc-Bar-Sam-Val-Wiz, Dwa-Elf-Gno-Hum-Orc, Law-Neu-Cha, Fem-Mal
Underway: Cav-Dwa-Law-Fem
To go: Cav-Hea-Kni-Mon-Pri-Ran-Rog-Tou