From: "James K. Lowden" <jklowden@schemamania.org>
To: gcc-help@gcc.gnu.org
Subject: access to include path in front end
Date: Mon, 28 Nov 2022 18:09:51 -0500 [thread overview]
Message-ID: <20221128180951.9aeaf90ea790bc26294df8ef@schemamania.org> (raw)
I don't understand how to access in a front end the arguments to the -I
option on the command line.
Cobol has a feature similar to the C preprecessor, known as the
Compiler Directing Facility (CDF). The CDF has a COPY statement that
resembles an #include directive in C, and shares the property that COPY
names a file that is normally found in a "copybook" which, for our
purposes, is a directory of such files. The name of that directory is
defined outside the Cobol program.
I would like to use the -I option to pass the names of copybook
directories to the cobol front end. A bit of exploration leaves me
with the sense that it's not that simple because the -I argument, in
C at least, is not passed to the compiler, but to the preprocessor.
Access to -fmax-errors I think I've figured out, but -I is a mystery.
I'm sure other front ends have similar needs. I didn't want to follow
the -J option in Fortran. Which should I think of as the canonical
example?
I'm a little puzzled by the status quo as I understand it. Unless I
missed it, it's not discussed in gccint. ISTM ideally there would be
some kind of getopt(3) processing, and the whole set of command-line
options captured in an array of structures accessible to any front
end. Is that not the case and, if not, why not?
Many thanks.
--jkl
reply other threads:[~2022-11-28 23:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221128180951.9aeaf90ea790bc26294df8ef@schemamania.org \
--to=jklowden@schemamania.org \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).