-std=gnu99? can it be removed?

Jay K jay.krell at cornell.edu
Sun Jun 20 01:50:52 CEST 2010

Can gmp do without "-std=gnu99"?

You know -- doesn't it work well and find with gcc, without -std=gnu99?

In particular, it is the addition of -std=gnu99 that causes problems on MacOSX.
  It leads to inline not working right, in terms of duplication vs. static vs. extern, etc. -- link errors.

It is removing -std=gnu99 seemingly by accident, that makes gmp work when part of the gcc tree.
 That is, when you put gmp in the gcc tree, gmp doesn't use the -std=gnu99 flag, probably across all targets (Linux, BSD, Solaris, Darwin, Cygwin, etc.)
  This is seemingly a pretty popular configuration, at least among people that build gcc.

Yes, I know gcc-4.2 also fixes it.
I know this is considered a bug in Apple's 4.0 compiler.
 (I wonder though -- is gcc 4.0 much used otherwise? Perhaps it is a bug in mainline gcc 4.0, not Apple specific? I haven't tried it.)

But still -- is -std=gnu99 really needed?
It seems to work fine without it -- as evidenced by building cc.
But I didn't investigate the level of inlining.

Surely inlining was doable well enough with gcc before -std=gnu99 existed?

I've just come back to building gmp again outside the gcc tree and this is again a problem.
The default gcc seems to work quite fine otherwise, I've used it a lot.
I *speculate* that -std=gnu99 just isn't used that much, at least not with the Apple 4.0 gcc.

 - Jay

More information about the gmp-discuss mailing list