-fdump-translation-unit considered harmful
Pjotr Kourzanov
peter.kourzanov@xs4all.nl
Mon Dec 20 22:37:00 GMT 2004
Joe Buck wrote:
> On Sun, Dec 19, 2004 at 02:35:06PM -0600, Aaron W. LaFramboise wrote:
>
>>4. A binary API that interfaced with GCC would require the client party
>>to the interface to adhere to the GPL, and thereby require the client to
>>be /free software/. Would this address Richard Stallman's concerns
>>about the danger of making it easy for proprietary non-free programs to
>>freeload off GCC?
>
>
> For anyone interested in interfacing proprietary programs to GCC, that's
> not even much of a speed bump.
>
> As soon as that binary API is written, someone will write a small calling
> program that will use the API to dump the translation unit into a nicely
> documented XML format. The dumper will, of course, be released under the
> GPL. Then the proprietary backend will simply read in the XML data.
I suspect the XML output thus generated will be comparable is size to
what -fdump-translation-unit generates now. As it is, it takes *ages* to
re-parse those megabytes of ASCII data (even for simple C source files
including lots of headers). The really problematic case is only when a
binary API at the tree level is exposed.
>
> That said, in the long term the free software world needs good code
> analysis tools, so I suspect that at some point the FSF will have to
> revisit this policy.
>
>
>>I understand the "GCC should be a compiler only." arguments, but it
>>seems there is a genuine demand in the free software community for a
>>high-quality source analyzer, particularly for languages like C++ where
>>this is not trivial. GCC seems to be very nearly where it needs to be
>>to fill this need.
>
>
> Agreed; in any case the proprietary software world just licenses a very good
> C++ front end from [some company, since we're not supposed to plug proprietary
> software on this list, but most of us know who], for quite reasonable cost,
> so the fact that they can't use the g++ front end doesn't slow them down
> much.
>
> But this is an argument that you'll have to make with RMS.
>
Will that still be a problem if such a back-end would be required to
be supplied in source-form (read: a script)? The front-end would then
first compile the script and check that it's compliant to whatever
rules, before compiling actual C(++) code and applying the script's
actions on the tree.
More information about the Gcc
mailing list