aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/scanner.c
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2020-10-14 15:48:22 +0200
committerTobias Burnus <tobias@codesourcery.com>2020-10-14 15:48:22 +0200
commit4aa9742252ea419947fe32ff64c7546c92286b96 (patch)
tree7987aa8f357420c58ecd58572ea75e030354d4b5 /gcc/fortran/scanner.c
parentec5e6467091ee0f8de2f894f0c1669465a8440f1 (diff)
downloadgcc-4aa9742252ea419947fe32ff64c7546c92286b96.zip
gcc-4aa9742252ea419947fe32ff64c7546c92286b96.tar.gz
gcc-4aa9742252ea419947fe32ff64c7546c92286b96.tar.bz2
Fortran: Fix line-truncation warning for !$acc and !gcc$
gcc/fortran/ChangeLog: PR fortran/97390 * scanner.c (load_line): Fix line-truncation warning for !$acc and !gcc$ in free-form source code. gcc/testsuite/ChangeLog: PR fortran/97390 * gfortran.dg/goacc/warn_truncated.f90: New test.
Diffstat (limited to 'gcc/fortran/scanner.c')
-rw-r--r--gcc/fortran/scanner.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 6f93508..fd11f5a 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -1876,13 +1876,13 @@ load_line (FILE *input, gfc_char_t **pbuf, int *pbuflen, const int *first_char)
if (((*pbuf)[comment_ix+1] == 'g' || (*pbuf)[comment_ix+1] == 'G')
&& ((*pbuf)[comment_ix+2] == 'c' || (*pbuf)[comment_ix+2] == 'C')
&& ((*pbuf)[comment_ix+3] == 'c' || (*pbuf)[comment_ix+3] == 'C')
- && (*pbuf)[comment_ix+4] == '$')
+ && c == '$')
first_comment = seen_comment = false;
if (flag_openacc
&& (*pbuf)[comment_ix+1] == '$'
&& ((*pbuf)[comment_ix+2] == 'a' || (*pbuf)[comment_ix+2] == 'A')
&& ((*pbuf)[comment_ix+3] == 'c' || (*pbuf)[comment_ix+3] == 'C')
- && ((*pbuf)[comment_ix+4] == 'c' || (*pbuf)[comment_ix+4] == 'C'))
+ && (c == 'c' || c == 'C'))
first_comment = seen_comment = false;
}