Page MenuHomeFreeBSD

Fix clang error builtin-requires-header on pthread_create
AbandonedPublic

Authored by alfredo.junior_eldorado.org.br on Feb 18 2019, 5:25 PM.

Details

Summary

This change disables -Werror,-Wbuiltin-requires-header when compiling with clang.

Clang 8 is getting confused about having to include Clang's built-in "pthread.h" while it's trying to compile FreeBSD "pthread.h" itself. The error bellow repeats mentioning "pthread_create" on many other places. (similar issue https://lkml.org/lkml/2019/1/11/718)

PR: 235583

Test Plan
  • buildworld for x86_64
  • buildworld for powerpc64 (cross)

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 22557
Build 21691: arc lint + arc unit

Event Timeline

pfg added a subscriber: pfg.Feb 22 2019, 3:16 AM

I am unsure if it is a style rule but we generally place such pragmas before and after all declarations so that they don't get in the way of easier reading.

In this case it is not worth it, but you may want to check __NULLABILITY_PRAGMA_PUSH and __NULLABILITY_PRAGMA_POP in sys/sys/cdefs.h, and where such macros are located in the headers.

With source updated to revision 344922 this patch isn't needed anymore. It was fixed by other change somehow, so I'm abandoning this change.

Thank you all for the inputs.