From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60139 invoked by alias); 21 Aug 2015 09:12:22 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 60120 invoked by uid 48); 21 Aug 2015 09:12:17 -0000 From: "ibuclaw at gdcproject dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/67304] New: Allow front-ends to share command-line options with different behaviours Date: Fri, 21 Aug 2015 09:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: ibuclaw at gdcproject dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-08/txt/msg01475.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67304 Bug ID: 67304 Summary: Allow front-ends to share command-line options with different behaviours Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: ibuclaw at gdcproject dot org Target Milestone: --- Marking as enhancement, as I'm sure that my situation is pretty unique (also coming from a frontend maintained outside of gcc). There are a couple of compiler-provided features in my frontend's frontend that does the following for any provided source code to the compiler: - Generate documentation. - Generate 'header' sources. Both come with independent options to set either the output file or directory. Because they are 'generator' features, and do not have any effect on the compilation process or codegen (unlike, for instance -fno-bounds-check), I'm a bit wary of using an -fxxx option for them. The upstream reference compiler uses the following options: --- -D generate documentation -Dd write documentation file to directory -Df write documentation file to filename -H generate 'header' file -Hd write 'header' file to directory -Hf write 'header' file to filename --- Whilst it may seem natural to use the same options (also a win for existing build tools), alas this is no good because C/C++ claims both -D and -H as theirs and theirs only. This seems overtly restricted. For me, it makes more sense if the generated options.[ch] files had two levels for handling front-end provided options. 1. To determine if the language handles -X 2. To forward -X to the language specific handler for processing/help/errors. However I am not too familiar with the awk files used in the process, so I'm not sure how much of an undertaking this will be. N.B. There's been a -J option in my frontend for some 12 years now, I'm not sure if this precedes Fortran (long before my time when I picked up the compiler), but Fortran claims it as theirs. However I use it for something completely different, and I guess it's only pure chance that we share identical command-line usage. ;)