-fdump-translation-unit considered harmful

Joe Buck Joe.Buck@synopsys.COM
Mon Dec 20 17:35:00 GMT 2004

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.

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

But this is an argument that you'll have to make with RMS.

More information about the Gcc mailing list