aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2025-04-14 19:32:43 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2025-04-14 19:32:43 +0200
commitd0b41f3d6d0ace2b0ca57d105cd7fd8361d0b2a8 (patch)
tree4b675fbe280e20db45337d3ee4a303055b1b9cda /gcc
parente96cb35ceb08bb6d12670172115f27819c806e82 (diff)
downloadgcc-d0b41f3d6d0ace2b0ca57d105cd7fd8361d0b2a8.zip
gcc-d0b41f3d6d0ace2b0ca57d105cd7fd8361d0b2a8.tar.gz
gcc-d0b41f3d6d0ace2b0ca57d105cd7fd8361d0b2a8.tar.bz2
cobol: Fix up COBOL -include [PR119777]
I was looking through options.cc diff between GCC 14 and 15, looking for entries with added CL_Cobol where at least one other language is present and was present before too. Besides the -fsyntax-only changes this is the only other one I found, COBOL adds Var(cobol_include) to something which didn't have a Var at all before and IMHO it is actively harmful. Because one can specify multiple -include file1 -include file2 options, both in C/C++ etc. and in COBOL as well (as documented in the man page). A Var can track just one entry. cobol_langhook_handle_option should use arg instead. 2025-04-14 Jakub Jelinek <jakub@redhat.com> PR cobol/119777 * lang.opt (include): Remove Var(cobol_include). * cobol1.cc (cobol_langhook_handle_option) <case OPT_include>: Use arg instead of cobol_include.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cobol/cobol1.cc4
-rw-r--r--gcc/cobol/lang.opt2
2 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cobol/cobol1.cc b/gcc/cobol/cobol1.cc
index 98d15a8..7d742b9 100644
--- a/gcc/cobol/cobol1.cc
+++ b/gcc/cobol/cobol1.cc
@@ -413,8 +413,8 @@ cobol_langhook_handle_option (size_t scode,
}
return true;
case OPT_include:
- if( ! include_file_add(cobol_include) ) {
- cbl_errx( "could not include %s", cobol_include);
+ if( ! include_file_add(arg) ) {
+ cbl_errx( "could not include %s", arg);
}
return true;
diff --git a/gcc/cobol/lang.opt b/gcc/cobol/lang.opt
index 142ec4f..1d33f34 100644
--- a/gcc/cobol/lang.opt
+++ b/gcc/cobol/lang.opt
@@ -114,7 +114,7 @@ Cobol Joined Separate
; Documented in C
include
-Cobol Joined Separate Var(cobol_include)
+Cobol Joined Separate
; Documented in C
isysroot