From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.schemamania.org (rrcs-50-75-19-234.nys.biz.rr.com [50.75.19.234]) by sourceware.org (Postfix) with ESMTP id 093C83854546 for ; Mon, 28 Nov 2022 23:41:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 093C83854546 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=schemamania.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=schemamania.org Received: from oak.schemamania.org (localhost [IPv6:::1]) by mail.schemamania.org (Postfix) with ESMTP id EB6D8256FABB for ; Mon, 28 Nov 2022 18:09:51 -0500 (EST) Date: Mon, 28 Nov 2022 18:09:51 -0500 From: "James K. Lowden" To: gcc-help@gcc.gnu.org Subject: access to include path in front end Message-Id: <20221128180951.9aeaf90ea790bc26294df8ef@schemamania.org> X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.28; x86_64--netbsd) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,PDS_RDNS_DYNAMIC_FP,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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