public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: "James K. Lowden" <jklowden@schemamania.org>
Cc: gcc@gcc.gnu.org
Subject: Re: access to include path in front end
Date: Wed, 30 Nov 2022 08:49:35 +0100	[thread overview]
Message-ID: <CAFiYyc21hWaTUnYHWYiErGhkYcHuhek8wOPaKpadwCQ8+W_VTQ@mail.gmail.com> (raw)
In-Reply-To: <20221129100804.c5b3e5bc669ff92f2100c3a3@schemamania.org>

On Tue, Nov 29, 2022 at 4:41 PM James K. Lowden
<jklowden@schemamania.org> wrote:
>
> 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 yesterday left
> me with the sense that 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 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?

The frontends have access to the set of passed options via the
option processing langhooks (and there's also global_options
and global_options_set), -I would be the OPT_I option (currently
only enabled for some frontends, you can add that in your
language specific .opt file).  The set of include directories is
not in any way special here.

Richard.

> Many thanks.
>
> --jkl

  reply	other threads:[~2022-11-30  7:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 15:08 James K. Lowden
2022-11-30  7:49 ` Richard Biener [this message]
2022-11-30 17:18   ` James K. Lowden
2022-11-30 15:58 ` Michael Matz
2022-11-30 17:58   ` Jonathan Wakely
2022-12-01 16:11   ` James K. Lowden
2022-12-01 17:14     ` Michael Matz
2022-12-02 18:27       ` James K. Lowden
2022-12-05 14:01         ` Michael Matz

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=CAFiYyc21hWaTUnYHWYiErGhkYcHuhek8wOPaKpadwCQ8+W_VTQ@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jklowden@schemamania.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).