100 Compiler Options and You are Out

California, along with Major League Baseball, is among the institutions that have a policy of “Three Strikes and You are Out.”

I suggest the same rule should apply to compiler writers.

For example, I just tried to port some software that makes use of gcc, the standard Linux C compiler, only to get an error message about a problem with an option.

I then did “man gcc” to review the list of options. As best as I can tell, there are well over a hundred of them.

This is ridiculous. How can any person be expected to make meaningful use of such a superfluity of programming madness.

Let’s do the math. I once read there are about 2**80 atoms in the universe. If there are 100 options to gcc, then are there 2**100 ways of compiling a program, which is 10**20 more times options than there are atoms in the universe!.

If we assign one Richard Stallman to test each possibility, then we need at least 10**20 RMS’s just to test the path flow for options!

GCC Folks: Get your act together. If you can’t come up with a small, reasonable set of options, then I suggest you should leave the compiler game and let the grownups take over.

Four colors suffice to color a map. I’ll give you double that, so can you please cut the number of options down to 8?



  1. Anon
    Posted June 30, 2009 at 10:10 | Permalink | Reply

    The estimated number of atoms in the observable universe is around 10^80, not 2^80.

    Still a lot of compiler options, though.

  2. subgenius
    Posted June 30, 2009 at 22:26 | Permalink | Reply

    And this is a problem……?:p

  3. James_T
    Posted July 2, 2009 at 13:46 | Permalink | Reply

    I’d agree that there are a huge number of options that no normal user would need. However I don’t think there are anything like 2^100 independent combinations as (a) some options imply others and (b) some are “bundles”. I think that 8’s a bit optimistic though (maybe 8-12 general user ones, and then a bunch of specialist things [e.g. running as a cross-compiler] that could be hidden in a separate man page).

    P.S. This page renders abominably in Konqueror (3.5.7) as a column of links is superposed on the text.

    Dave replies:

    I agree that the option space is not as large as I first wrote. However, I believe any programmer has a duty to limit the number of program options to an absolute minimum. That is part of a good design.

    To allow options that cover every possible case is a cop-out, asking the user to wade through a sea of options when they have better things to do.

    For example, gcc has scores of -W options to specify which warnings should be issued. I would use a notion of level, such as “who cares, I just want to run it,” “common-sense,” ” “‘conservative” and “purist – tell me everything.”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Pages

  • June 2009
    M T W T F S S
    « May   Jul »
  • RSS The Wayward Word Press

  • Recent Comments

    mrrdev on On being the maintainer, sole…
    daveshields on On being the maintainer, sole…
    James Murray on On being the maintainer, sole…
    russurquhart1 on SPITBOL for OSX is now av…
    dave porter on On being the maintainer, sole…
  • Archives

  • Blog Stats

  • Top Posts

  • Top Rated

  • Recent Posts

  • Archives

  • Top Rated

  • %d bloggers like this: