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
Unknown Object (File)
Fri, Nov 22, 12:22 AM
Unknown Object (File)
Fri, Nov 22, 12:21 AM
Unknown Object (File)
Wed, Nov 20, 9:01 AM
Unknown Object (File)
Oct 16 2024, 3:52 AM
Unknown Object (File)
Oct 3 2024, 8:41 AM
Unknown Object (File)
Oct 3 2024, 1:00 AM
Unknown Object (File)
Oct 2 2024, 11:06 AM
Unknown Object (File)
Sep 27 2024, 9:14 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.