public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* access to include path in front end
@ 2022-11-28 23:09 James K. Lowden
  0 siblings, 0 replies; only message in thread
From: James K. Lowden @ 2022-11-28 23:09 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-28 23:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-28 23:09 access to include path in front end James K. Lowden

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).