[LLVMdev] include/Config/config.h discrepancies between CMake and autofoo builds

Eric Christopher echristo at apple.com
Wed Jan 5 10:02:34 PST 2011


On Jan 5, 2011, at 9:58 AM, Óscar Fuentes wrote:

> Eric Christopher <echristo at apple.com> writes:
> 
>>>> Or cleanup both headers from unused stuff by Eric's
>>>> suggestion?
>>> 
>>> I'm not sure this is a good idea (not that it is bad either). Murphy's
>>> Law says that a function that you remove today will be used tomorrow.
>> 
>> I meant literally functions that aren't used in the codebase. No need to
>> look for them if we're not using them.
> 
> Sorry, bad wording. What I'm trying to say is that if you remove a
> function check just because it is not used by the codebase today maybe
> some programmer will need that function tomorrow. And adding an autoconf
> check is far from trivial, at least for those not familiarized with the
> autotools.
> 

Adding a check for most standard functions is amazingly trivial:

AC_CHECK_FUNCS([backtrace ceilf floorf roundf rintf nearbyintf getcwd ])
AC_CHECK_FUNCS([powf fmodf strtof round ])
AC_CHECK_FUNCS([getpagesize getrusage getrlimit setrlimit gettimeofday ])
AC_CHECK_FUNCS([isatty mkdtemp mkstemp ])
AC_CHECK_FUNCS([mktemp posix_spawn realpath sbrk setrlimit strdup ])
AC_CHECK_FUNCS([strerror strerror_r strerror_s setenv ])
AC_CHECK_FUNCS([strtoll strtoq sysconf malloc_zone_statistics ])
AC_CHECK_FUNCS([setjmp longjmp sigsetjmp siglongjmp])

contains most of them. If they're non-trivial (like the ones I needed to
add for OSX functionality) that's a different story.

> IMHO removing configure checks because they are not used by the codebase
> right now is not an improvement similar to removing dead code from the
> C++ sources.

I disagree.

-eric



More information about the llvm-dev mailing list