Skip to content

configure script misdetects compiler built-ins as available functions #178

@Un1q32

Description

@Un1q32

The configure script sometimes has false positives for functions like strnlen where the compiler does optimizations to remove it's use.

As you can see here when the configure script's strnlen test is built with a modern clang with optimizations enabled, it is optimized to a simple return 0, since clang knows about strnlen and knows that if the function is working properly it will always succeed.

The solution is to build those feature tests with -fno-builtin, which disables optimizations related to known functions in the standard library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions