Page MenuHomeFreeBSD

Fix clang error builtin-requires-header on pthread_create
AbandonedPublic

Authored by alfredo on Feb 18 2019, 5:25 PM.
Tags
None
Referenced Files
F82060096: D19236.id54045.diff
Thu, Apr 25, 3:31 AM
Unknown Object (File)
Sat, Apr 20, 2:27 PM
Unknown Object (File)
Fri, Apr 19, 6:35 PM
Unknown Object (File)
Fri, Apr 19, 4:49 PM
Unknown Object (File)
Wed, Apr 17, 7:05 PM
Unknown Object (File)
Wed, Apr 17, 6:58 PM
Unknown Object (File)
Tue, Apr 9, 2:03 PM
Unknown Object (File)
Feb 23 2024, 10:05 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 - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22557
Build 21691: arc lint + arc unit

Event Timeline

alfredo edited the test plan for this revision. (Show Details)
alfredo added reviewers: jhibbits, bdragon, emaste.
alfredo added a subscriber: linimon.

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.