This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: Disallow checking for upper case characters in gfc_match


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


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