Bizarre test for main in libm

Richard Earnshaw rearnsha@arm.com
Thu May 1 10:38:00 GMT 2003


libstdc++-v3/aclocal.m4 contains the following test:

dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
  dnl Check for complex versions of math functions of platform.
  AC_CHECK_LIB(m, main)

Now this test for main in libm is broken as best I can see, since it is 
expanded into

int main() {
  main()
; return 0; }

Which of course always compiles and links without error (since it's 
recursive).

Does anyone know why that test is there in the first place?

R.



More information about the Libstdc++ mailing list