public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/92805] gfortran: blanks within literal constants should not be allowed
[not found] <bug-92805-4@http.gcc.gnu.org/bugzilla/>
@ 2021-09-08 19:29 ` anlauf at gcc dot gnu.org
2021-09-08 20:33 ` kargl at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-08 19:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |anlauf at gcc dot gnu.org
--- Comment #9 from anlauf at gcc dot gnu.org ---
(In reply to Steve Kargl from comment #4)
> Tested.
I tried to resurrect your patch, but it partly misses on the following:
integer, parameter :: ck = kind ("a") ! default character kind
print *, ck_"a"
print *, ck _"a"
print *, ck_ "a"
print *, 1_"a"
print *, 1 _"a"
print *, 1_ "a"
end
pr92805.f90:3:19:
3 | print *, ck _"a"
| 1
Error: Syntax error in PRINT statement at (1)
pr92805.f90:4:20:
4 | print *, ck_ "a"
| 1
Error: Syntax error in PRINT statement at (1)
For some reason we detect only some of the syntax violations.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/92805] gfortran: blanks within literal constants should not be allowed
[not found] <bug-92805-4@http.gcc.gnu.org/bugzilla/>
2021-09-08 19:29 ` [Bug fortran/92805] gfortran: blanks within literal constants should not be allowed anlauf at gcc dot gnu.org
@ 2021-09-08 20:33 ` kargl at gcc dot gnu.org
2022-07-28 19:50 ` anlauf at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu.org @ 2021-09-08 20:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #10 from kargl at gcc dot gnu.org ---
(In reply to anlauf from comment #9)
> (In reply to Steve Kargl from comment #4)
> > Tested.
>
> I tried to resurrect your patch, but it partly misses on the following:
>
> integer, parameter :: ck = kind ("a") ! default character kind
> print *, ck_"a"
> print *, ck _"a"
> print *, ck_ "a"
> print *, 1_"a"
> print *, 1 _"a"
> print *, 1_ "a"
> end
>
> pr92805.f90:3:19:
>
> 3 | print *, ck _"a"
> | 1
> Error: Syntax error in PRINT statement at (1)
> pr92805.f90:4:20:
>
> 4 | print *, ck_ "a"
> | 1
> Error: Syntax error in PRINT statement at (1)
>
> For some reason we detect only some of the syntax violations.
Thanks for taking a look. I completely forgot about
character kinds. I wonder if the difference/problem
is caused by location. Numeric kinds are suffixes on
the literal constant while character kinds are prefixes.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/92805] gfortran: blanks within literal constants should not be allowed
[not found] <bug-92805-4@http.gcc.gnu.org/bugzilla/>
2021-09-08 19:29 ` [Bug fortran/92805] gfortran: blanks within literal constants should not be allowed anlauf at gcc dot gnu.org
2021-09-08 20:33 ` kargl at gcc dot gnu.org
@ 2022-07-28 19:50 ` anlauf at gcc dot gnu.org
2022-07-28 20:12 ` anlauf at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-07-28 19:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |anlauf at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #11 from anlauf at gcc dot gnu.org ---
I now have a complete patch which is regtesting...
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/92805] gfortran: blanks within literal constants should not be allowed
[not found] <bug-92805-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2022-07-28 19:50 ` anlauf at gcc dot gnu.org
@ 2022-07-28 20:12 ` anlauf at gcc dot gnu.org
2022-07-31 18:50 ` cvs-commit at gcc dot gnu.org
2022-07-31 18:52 ` anlauf at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-07-28 20:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805
--- Comment #12 from anlauf at gcc dot gnu.org ---
Submitted: https://gcc.gnu.org/pipermail/fortran/2022-July/058023.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/92805] gfortran: blanks within literal constants should not be allowed
[not found] <bug-92805-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2022-07-28 20:12 ` anlauf at gcc dot gnu.org
@ 2022-07-31 18:50 ` cvs-commit at gcc dot gnu.org
2022-07-31 18:52 ` anlauf at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-31 18:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805
--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>:
https://gcc.gnu.org/g:d325e7048c85e13f12ea79aebf9623eddc7ffcaf
commit r13-1905-gd325e7048c85e13f12ea79aebf9623eddc7ffcaf
Author: Harald Anlauf <anlauf@gmx.de>
Date: Thu Jul 28 22:07:02 2022 +0200
Fortran: detect blanks within literal constants in free-form mode [PR92805]
gcc/fortran/ChangeLog:
PR fortran/92805
* match.cc (gfc_match_small_literal_int): Make gobbling of leading
whitespace optional.
(gfc_match_name): Likewise.
(gfc_match_char): Likewise.
* match.h (gfc_match_small_literal_int): Adjust prototype.
(gfc_match_name): Likewise.
(gfc_match_char): Likewise.
* primary.cc (match_kind_param): Match small literal int or name
without gobbling whitespace.
(get_kind): Do not skip over blanks.
(match_string_constant): Likewise.
gcc/testsuite/ChangeLog:
PR fortran/92805
* gfortran.dg/literal_constants.f: New test.
* gfortran.dg/literal_constants.f90: New test.
Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/92805] gfortran: blanks within literal constants should not be allowed
[not found] <bug-92805-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2022-07-31 18:50 ` cvs-commit at gcc dot gnu.org
@ 2022-07-31 18:52 ` anlauf at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: anlauf at gcc dot gnu.org @ 2022-07-31 18:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805
anlauf at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #14 from anlauf at gcc dot gnu.org ---
Fixed for gcc-13. Closing.
Thanks for the report!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-07-31 18:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-92805-4@http.gcc.gnu.org/bugzilla/>
2021-09-08 19:29 ` [Bug fortran/92805] gfortran: blanks within literal constants should not be allowed anlauf at gcc dot gnu.org
2021-09-08 20:33 ` kargl at gcc dot gnu.org
2022-07-28 19:50 ` anlauf at gcc dot gnu.org
2022-07-28 20:12 ` anlauf at gcc dot gnu.org
2022-07-31 18:50 ` cvs-commit at gcc dot gnu.org
2022-07-31 18:52 ` anlauf at gcc dot gnu.org
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).