On Mon, Mar 19, 2007 at 02:56:03PM -0400, Andy Dougherty wrote:
> In my opinion, that way lies madness. Generating a list of options which
> all possible current and future compilers will accept is not only
> impossible, it's pointless. It's also aggravating that there's no way to
> override it or tell Configure "Yes, cc is my compiler even though it's not
> in your list."
It's like Inline::C telling me that $Config{cc} doesn't appear to be a
compiler. Yes, you can't find "ccache cc" down my $PATH, but if you try
executing it, you'll find that it works just fine.
> The only way to tell for sure if you have a working compiler is to try to
> compile and run something. After the user has been prompted for all the
> flags, simply try to compile and run a simple test program. If it works,
> fine. If it doesn't, then complain with an informative error message. (It
> may be appropriate to skip the 'run' step in a cross-compilation
> environment and hope that the user got the flags right if the compilation
> succeeds.)
int main() {
return 0;
}
being a fairly good minimal example. I think that it's legal C++ too.
IIRC
main;
was found to be the shortest portable crash. :-)
Nicholas Clark