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)
Feb 23 2024, 10:05 PM
Unknown Object (File)
Feb 8 2024, 3:02 PM
Unknown Object (File)
Jan 3 2024, 6:22 PM
Unknown Object (File)
Dec 22 2023, 10:13 PM
Unknown Object (File)
Dec 21 2023, 10:06 AM
Unknown Object (File)
Dec 10 2023, 1:10 PM
Unknown Object (File)
Nov 22 2023, 12:38 AM
Unknown Object (File)
Oct 30 2023, 5:04 AM

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.