From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 4D0403858D28 for ; Wed, 30 Nov 2022 07:49:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4D0403858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x231.google.com with SMTP id a7so19926385ljq.12 for ; Tue, 29 Nov 2022 23:49:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=gFX9SciuUvIEwTLxMncrdHZglCRQvVvsDrTA4nCvgbU=; b=Li8f0IsUuiWzbnd+ob/W277tjJJXFUyx3y6nZXJvsfH0DB4d8P7ixYiLkDcIMwllUN aI6Wz7s+FaQfpHzVAjUqo5SA8NsCMEzU93S9K4BxFtONrN+ZhpkE2fmTrQSDudUitG7f vCZRk+2mo3Q7Xvrx1nz8UTeTepbQhDrc5Ik4fbl9Xh8GAyubDqlZkFcrlsfokLtZjDa/ UK4Ki7n+1P6CKmN3qLb85IG48JGxE4BPck8veNSAehOip4HydKFiAX2ohLvTltYJG+i/ /FcLb+Ayrucb08RINXCWHyzhu+7cZaQonsCO8uAjxSeGuUV+uGXEIz6nMA1Aengyr6YS JzVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gFX9SciuUvIEwTLxMncrdHZglCRQvVvsDrTA4nCvgbU=; b=gOexuAC1y2MmXXpmbZQYIY/aFcJkXAMV71OHGMm57kr1vMe02I01SLCFHxP0wXk9/z UzAOJpw37qixPVv1g6b8IKtSJOaKNXO4Nty6wapwy2YXKB5bJ0KmcF3vePQmKXuo0jvF 8+0HwShfE4AN5EimJfra0onPnKa3CwWqGKunDG5mXRfKXhkQmy3qVxjxomJG/i9EkM+G jwcIh56DK4wakN1n9q58jyfVLZD6DZSu2OtrZHhxACmZcS7Ei6PShs63CeDiEeRQN9E8 4uQChyOqy+TlrqYUX7x0ZDnIaDxYQVp9uo82TESf06sNllz+zrbJbe6AdhlCVSxNZsWF byyg== X-Gm-Message-State: ANoB5pkJouT0ouU97m0oQDOZTIP7B/blPxa+OqW3yVDhSrhxcD7ydTKV 0IUA9uNThnH5jRJjiiLRutTZpo1CLCylo77WOwUvME9M X-Google-Smtp-Source: AA0mqf4UWadbQLcOoPz0XENnciVBnsaBDgOEUaAqC3GkR6yjivbePGet2bTPtddZFihzRozodBAWogE0MsviGZwFI8U= X-Received: by 2002:a2e:3a10:0:b0:279:8e65:20a7 with SMTP id h16-20020a2e3a10000000b002798e6520a7mr8907081lja.356.1669794587583; Tue, 29 Nov 2022 23:49:47 -0800 (PST) MIME-Version: 1.0 References: <20221129100804.c5b3e5bc669ff92f2100c3a3@schemamania.org> In-Reply-To: <20221129100804.c5b3e5bc669ff92f2100c3a3@schemamania.org> From: Richard Biener Date: Wed, 30 Nov 2022 08:49:35 +0100 Message-ID: Subject: Re: access to include path in front end To: "James K. Lowden" Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Nov 29, 2022 at 4:41 PM James K. Lowden 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