Skip to content

[libc] fix lint warnings from including <fenv.h> #82695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nickdesaulniers
Copy link
Member

Towards the goal of getting ninja libc-lint back to green, fixes just src/ and
not test/. Fixes:

libc/src/fenv/fegetexceptflag.cpp:13:1: error: system include fenv.h not
allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]
   13 | #include <fenv.h>
      | ^~~~~~~~~~~~~~~~~

/android0/llvm-project/libc/src/fenv/feholdexcept.h:12:1: error: system
include fenv.h not allowed, transitively included from
libc/src/fenv/feholdexcept.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/__support/FPUtil/FEnvImpl.h:17:1: error: system include fenv.h not
allowed, transitively included from libc/src/__support/FPUtil/FEnvImpl.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/__support/FPUtil/rounding_mode.h:14:1: error: system include
fenv.h not allowed, transitively included from
libc/src/__support/FPUtil/rounding_mode.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/__support/FPUtil/x86_64/FEnvImpl.h:19:1: error: system include
fenv.h not allowed, transitively included from
libc/src/__support/FPUtil/x86_64/FEnvImpl.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/fegetexceptflag.h:12:1: error: system include fenv.h not
allowed, transitively included from libc/src/fenv/fegetexceptflag.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/feholdexcept.cpp:13:1: error: system include fenv.h not
allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/fesetenv.h:12:1: error: system include fenv.h not allowed,
transitively included from libc/src/fenv/fesetenv.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/fesetexceptflag.cpp:13:1: error: system include fenv.h not
allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/fesetexceptflag.h:12:1: error: system include fenv.h not
allowed, transitively included from libc/src/fenv/fesetexceptflag.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/feupdateenv.cpp:13:1: error: system include fenv.h not
allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/feupdateenv.h:12:1: error: system include fenv.h not allowed,
transitively included from libc/src/fenv/feupdateenv.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

Towards the goal of getting ninja libc-lint back to green, fixes just src/ and
not test/. Fixes:

    libc/src/fenv/fegetexceptflag.cpp:13:1: error: system include fenv.h not
    allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]
       13 | #include <fenv.h>
          | ^~~~~~~~~~~~~~~~~

    /android0/llvm-project/libc/src/fenv/feholdexcept.h:12:1: error: system
    include fenv.h not allowed, transitively included from
    libc/src/fenv/feholdexcept.h
    [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

    libc/src/__support/FPUtil/FEnvImpl.h:17:1: error: system include fenv.h not
    allowed, transitively included from libc/src/__support/FPUtil/FEnvImpl.h
    [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

    libc/src/__support/FPUtil/rounding_mode.h:14:1: error: system include
    fenv.h not allowed, transitively included from
    libc/src/__support/FPUtil/rounding_mode.h
    [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

    libc/src/__support/FPUtil/x86_64/FEnvImpl.h:19:1: error: system include
    fenv.h not allowed, transitively included from
    libc/src/__support/FPUtil/x86_64/FEnvImpl.h
    [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

    libc/src/fenv/fegetexceptflag.h:12:1: error: system include fenv.h not
    allowed, transitively included from libc/src/fenv/fegetexceptflag.h
    [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

    libc/src/fenv/feholdexcept.cpp:13:1: error: system include fenv.h not
    allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

    libc/src/fenv/fesetenv.h:12:1: error: system include fenv.h not allowed,
    transitively included from libc/src/fenv/fesetenv.h
    [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

    libc/src/fenv/fesetexceptflag.cpp:13:1: error: system include fenv.h not
    allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

    libc/src/fenv/fesetexceptflag.h:12:1: error: system include fenv.h not
    allowed, transitively included from libc/src/fenv/fesetexceptflag.h
    [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

    libc/src/fenv/feupdateenv.cpp:13:1: error: system include fenv.h not
    allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

    libc/src/fenv/feupdateenv.h:12:1: error: system include fenv.h not allowed,
    transitively included from libc/src/fenv/feupdateenv.h
    [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]
@llvmbot
Copy link
Member

llvmbot commented Feb 22, 2024

@llvm/pr-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

Changes

Towards the goal of getting ninja libc-lint back to green, fixes just src/ and
not test/. Fixes:

libc/src/fenv/fegetexceptflag.cpp:13:1: error: system include fenv.h not
allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]
   13 | #include &lt;fenv.h&gt;
      | ^~~~~~~~~~~~~~~~~

/android0/llvm-project/libc/src/fenv/feholdexcept.h:12:1: error: system
include fenv.h not allowed, transitively included from
libc/src/fenv/feholdexcept.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/__support/FPUtil/FEnvImpl.h:17:1: error: system include fenv.h not
allowed, transitively included from libc/src/__support/FPUtil/FEnvImpl.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/__support/FPUtil/rounding_mode.h:14:1: error: system include
fenv.h not allowed, transitively included from
libc/src/__support/FPUtil/rounding_mode.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/__support/FPUtil/x86_64/FEnvImpl.h:19:1: error: system include
fenv.h not allowed, transitively included from
libc/src/__support/FPUtil/x86_64/FEnvImpl.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/fegetexceptflag.h:12:1: error: system include fenv.h not
allowed, transitively included from libc/src/fenv/fegetexceptflag.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/feholdexcept.cpp:13:1: error: system include fenv.h not
allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/fesetenv.h:12:1: error: system include fenv.h not allowed,
transitively included from libc/src/fenv/fesetenv.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/fesetexceptflag.cpp:13:1: error: system include fenv.h not
allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/fesetexceptflag.h:12:1: error: system include fenv.h not
allowed, transitively included from libc/src/fenv/fesetexceptflag.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/feupdateenv.cpp:13:1: error: system include fenv.h not
allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

libc/src/fenv/feupdateenv.h:12:1: error: system include fenv.h not allowed,
transitively included from libc/src/fenv/feupdateenv.h
[llvmlibc-restrict-system-libc-headers,-warnings-as-errors]

Full diff: https://github.com/llvm/llvm-project/pull/82695.diff

16 Files Affected:

  • (modified) libc/src/__support/FPUtil/FEnvImpl.h (+1-1)
  • (modified) libc/src/__support/FPUtil/aarch64/FEnvImpl.h (+2-1)
  • (modified) libc/src/__support/FPUtil/arm/FEnvImpl.h (+2-1)
  • (modified) libc/src/__support/FPUtil/riscv/FEnvImpl.h (+2-1)
  • (modified) libc/src/__support/FPUtil/rounding_mode.h (+1-2)
  • (modified) libc/src/__support/FPUtil/x86_64/FEnvImpl.h (+2-1)
  • (modified) libc/src/fenv/fegetenv.h (+1-1)
  • (modified) libc/src/fenv/fegetexceptflag.cpp (+1-2)
  • (modified) libc/src/fenv/fegetexceptflag.h (+1-1)
  • (modified) libc/src/fenv/feholdexcept.cpp (+3-2)
  • (modified) libc/src/fenv/feholdexcept.h (+1-1)
  • (modified) libc/src/fenv/fesetenv.h (+1-1)
  • (modified) libc/src/fenv/fesetexceptflag.cpp (+3-2)
  • (modified) libc/src/fenv/fesetexceptflag.h (+1-1)
  • (modified) libc/src/fenv/feupdateenv.cpp (+2-1)
  • (modified) libc/src/fenv/feupdateenv.h (+1-1)
diff --git a/libc/src/__support/FPUtil/FEnvImpl.h b/libc/src/__support/FPUtil/FEnvImpl.h
index 6810659733de2c..ad5cc907188536 100644
--- a/libc/src/__support/FPUtil/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/FEnvImpl.h
@@ -9,12 +9,12 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_FENVIMPL_H
 #define LLVM_LIBC_SRC___SUPPORT_FPUTIL_FENVIMPL_H
 
+#include "include/llvm-libc-types/fenv_t.h"
 #include "src/__support/macros/attributes.h" // LIBC_INLINE
 #include "src/__support/macros/config.h"     // LIBC_HAS_BUILTIN
 #include "src/__support/macros/properties/architectures.h"
 #include "src/errno/libc_errno.h"
 
-#include <fenv.h>
 #include <math.h>
 
 #if defined(LIBC_TARGET_ARCH_IS_AARCH64)
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index e0eec17e038c63..14fc4d336da191 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_AARCH64_FENVIMPL_H
 #define LLVM_LIBC_SRC___SUPPORT_FPUTIL_AARCH64_FENVIMPL_H
 
+#include "include/llvm-libc-macros/fenv-macros.h"
+#include "include/llvm-libc-types/fenv_t.h"
 #include "src/__support/macros/attributes.h" // LIBC_INLINE
 #include "src/__support/macros/properties/architectures.h"
 
@@ -17,7 +19,6 @@
 #endif
 
 #include <arm_acle.h>
-#include <fenv.h>
 #include <stdint.h>
 
 #include "src/__support/FPUtil/FPBits.h"
diff --git a/libc/src/__support/FPUtil/arm/FEnvImpl.h b/libc/src/__support/FPUtil/arm/FEnvImpl.h
index ac4673cf20f632..163976daadb85b 100644
--- a/libc/src/__support/FPUtil/arm/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/arm/FEnvImpl.h
@@ -9,10 +9,11 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_ARM_FENVIMPL_H
 #define LLVM_LIBC_SRC___SUPPORT_FPUTIL_ARM_FENVIMPL_H
 
+#include "include/llvm-libc-macros/fenv-macros.h"
+#include "include/llvm-libc-types/fenv_t.h"
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/__support/macros/attributes.h" // For LIBC_INLINE
 
-#include <fenv.h>
 #include <stdint.h>
 
 namespace LIBC_NAMESPACE {
diff --git a/libc/src/__support/FPUtil/riscv/FEnvImpl.h b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
index b73c4798b0539a..a00570a9422ec4 100644
--- a/libc/src/__support/FPUtil/riscv/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/riscv/FEnvImpl.h
@@ -9,11 +9,12 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_RISCV_FENVIMPL_H
 #define LLVM_LIBC_SRC___SUPPORT_FPUTIL_RISCV_FENVIMPL_H
 
+#include "include/llvm-libc-macros/fenv-macros.h"
+#include "include/llvm-libc-types/fenv_t.h"
 #include "src/__support/FPUtil/FPBits.h"
 #include "src/__support/macros/attributes.h" // For LIBC_INLINE_ASM
 #include "src/__support/macros/config.h"     // For LIBC_INLINE
 
-#include <fenv.h>
 #include <stdint.h>
 
 namespace LIBC_NAMESPACE {
diff --git a/libc/src/__support/FPUtil/rounding_mode.h b/libc/src/__support/FPUtil/rounding_mode.h
index 91a5b9c50e7c2b..ab90037eb4d895 100644
--- a/libc/src/__support/FPUtil/rounding_mode.h
+++ b/libc/src/__support/FPUtil/rounding_mode.h
@@ -9,10 +9,9 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_ROUNDING_MODE_H
 #define LLVM_LIBC_SRC___SUPPORT_FPUTIL_ROUNDING_MODE_H
 
+#include "include/llvm-libc-macros/fenv-macros.h"
 #include "src/__support/macros/attributes.h" // LIBC_INLINE
 
-#include <fenv.h>
-
 namespace LIBC_NAMESPACE::fputil {
 
 // Quick free-standing test whether fegetround() == FE_UPWARD.
diff --git a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
index b73b70e907790f..b8e7b58256cda8 100644
--- a/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/x86_64/FEnvImpl.h
@@ -9,6 +9,8 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_X86_64_FENVIMPL_H
 #define LLVM_LIBC_SRC___SUPPORT_FPUTIL_X86_64_FENVIMPL_H
 
+#include "include/llvm-libc-macros/fenv-macros.h"
+#include "include/llvm-libc-types/fenv_t.h"
 #include "src/__support/macros/attributes.h" // LIBC_INLINE
 #include "src/__support/macros/properties/architectures.h"
 
@@ -16,7 +18,6 @@
 #error "Invalid include"
 #endif
 
-#include <fenv.h>
 #include <stdint.h>
 
 #include "src/__support/macros/sanitizer.h"
diff --git a/libc/src/fenv/fegetenv.h b/libc/src/fenv/fegetenv.h
index 658316482984e1..27fdfe2440db81 100644
--- a/libc/src/fenv/fegetenv.h
+++ b/libc/src/fenv/fegetenv.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_FENV_FEGETENV_H
 #define LLVM_LIBC_SRC_FENV_FEGETENV_H
 
-#include <fenv.h>
+#include "include/llvm-libc-types/fenv_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/fenv/fegetexceptflag.cpp b/libc/src/fenv/fegetexceptflag.cpp
index 71b87ce7315d1a..1f9aae6085ed8c 100644
--- a/libc/src/fenv/fegetexceptflag.cpp
+++ b/libc/src/fenv/fegetexceptflag.cpp
@@ -6,12 +6,11 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "include/llvm-libc-types/fexcept_t.h"
 #include "src/fenv/fegetexceptflag.h"
 #include "src/__support/FPUtil/FEnvImpl.h"
 #include "src/__support/common.h"
 
-#include <fenv.h>
-
 namespace LIBC_NAMESPACE {
 
 LLVM_LIBC_FUNCTION(int, fegetexceptflag, (fexcept_t * flagp, int excepts)) {
diff --git a/libc/src/fenv/fegetexceptflag.h b/libc/src/fenv/fegetexceptflag.h
index ad72161e536f83..aaf5184acce1e3 100644
--- a/libc/src/fenv/fegetexceptflag.h
+++ b/libc/src/fenv/fegetexceptflag.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_FENV_FEGETEXCEPTFLAG_H
 #define LLVM_LIBC_SRC_FENV_FEGETEXCEPTFLAG_H
 
-#include <fenv.h>
+#include "include/llvm-libc-types/fexcept_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/fenv/feholdexcept.cpp b/libc/src/fenv/feholdexcept.cpp
index 3c73b1f4217798..543320cc858463 100644
--- a/libc/src/fenv/feholdexcept.cpp
+++ b/libc/src/fenv/feholdexcept.cpp
@@ -7,11 +7,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/fenv/feholdexcept.h"
+
+#include "include/llvm-libc-macros/fenv-macros.h"
+#include "include/llvm-libc-types/fenv_t.h"
 #include "src/__support/FPUtil/FEnvImpl.h"
 #include "src/__support/common.h"
 
-#include <fenv.h>
-
 namespace LIBC_NAMESPACE {
 
 LLVM_LIBC_FUNCTION(int, feholdexcept, (fenv_t * envp)) {
diff --git a/libc/src/fenv/feholdexcept.h b/libc/src/fenv/feholdexcept.h
index bbefc4ecbd41b2..0405c6fc1e91d5 100644
--- a/libc/src/fenv/feholdexcept.h
+++ b/libc/src/fenv/feholdexcept.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_FENV_FEHOLDEXCEPT_H
 #define LLVM_LIBC_SRC_FENV_FEHOLDEXCEPT_H
 
-#include <fenv.h>
+#include "include/llvm-libc-types/fenv_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/fenv/fesetenv.h b/libc/src/fenv/fesetenv.h
index 8b56bebc2e36d4..f52fc1de753cf8 100644
--- a/libc/src/fenv/fesetenv.h
+++ b/libc/src/fenv/fesetenv.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_FENV_FESETENV_H
 #define LLVM_LIBC_SRC_FENV_FESETENV_H
 
-#include <fenv.h>
+#include "include/llvm-libc-types/fenv_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/fenv/fesetexceptflag.cpp b/libc/src/fenv/fesetexceptflag.cpp
index 2fe7cb571a8ddd..98d33c5b9db489 100644
--- a/libc/src/fenv/fesetexceptflag.cpp
+++ b/libc/src/fenv/fesetexceptflag.cpp
@@ -7,11 +7,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/fenv/fesetexceptflag.h"
+
+#include "include/llvm-libc-macros/fenv-macros.h"
+#include "include/llvm-libc-types/fexcept_t.h"
 #include "src/__support/FPUtil/FEnvImpl.h"
 #include "src/__support/common.h"
 
-#include <fenv.h>
-
 namespace LIBC_NAMESPACE {
 
 LLVM_LIBC_FUNCTION(int, fesetexceptflag,
diff --git a/libc/src/fenv/fesetexceptflag.h b/libc/src/fenv/fesetexceptflag.h
index 15e62eda1b840c..89bff8aeb01180 100644
--- a/libc/src/fenv/fesetexceptflag.h
+++ b/libc/src/fenv/fesetexceptflag.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_FENV_FESETEXCEPTFLAG_H
 #define LLVM_LIBC_SRC_FENV_FESETEXCEPTFLAG_H
 
-#include <fenv.h>
+#include "include/llvm-libc-types/fexcept_t.h"
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/fenv/feupdateenv.cpp b/libc/src/fenv/feupdateenv.cpp
index 7e81b9476da91b..8eeec26c305a04 100644
--- a/libc/src/fenv/feupdateenv.cpp
+++ b/libc/src/fenv/feupdateenv.cpp
@@ -6,11 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "include/llvm-libc-macros/fenv-macros.h"
+#include "include/llvm-libc-types/fenv_t.h"
 #include "src/fenv/feupdateenv.h"
 #include "src/__support/FPUtil/FEnvImpl.h"
 #include "src/__support/common.h"
 
-#include <fenv.h>
 
 namespace LIBC_NAMESPACE {
 
diff --git a/libc/src/fenv/feupdateenv.h b/libc/src/fenv/feupdateenv.h
index 294c041ddeae79..4c737cc406e609 100644
--- a/libc/src/fenv/feupdateenv.h
+++ b/libc/src/fenv/feupdateenv.h
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_SRC_FENV_FEUPDATEENV_H
 #define LLVM_LIBC_SRC_FENV_FEUPDATEENV_H
 
-#include <fenv.h>
+#include "include/llvm-libc-types/fenv_t.h"
 
 namespace LIBC_NAMESPACE {
 

Copy link

github-actions bot commented Feb 22, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@nickdesaulniers nickdesaulniers marked this pull request as draft February 22, 2024 22:56
@frobtech
Copy link
Contributor

I think we need to double-check that this is doing the right thing for cases like Fuchsia. The same might apply to the "overlay mode" builds too. In Fuchsia, we're using the llvm-libc sources, but entirely our legacy public API headers for the types users are really using. I think it may well be that fenv_t et al are defined with a per-arch ABI that's consistent for each arch across the legacy headers (both Fuchsia's and Linux cases like glibc, musl) and the llvm-libc implementation's internal and public API headers. It doesn't so much matter if the member names and internal structure of what is in embedded struct members or not and so forth matches between the API users are compiling against and the API llvm-libc code is compiling against, but it's crucial that the ABIs match. So while I think it might happen to be the case that it can be fudged in the case of <fenv.h> types and constants, that's not true in the general case. So to avoid any slippery slopes towards cases that are actually incorrect, we need to make sure that our style/lint rules are keeping us consistent with what's pedantically correct in all cases. That is, in the Fuchsia build or in "overlay mode" builds, we need to have the type definitions coming from the legacy system headers rather than from llvm-libc's headers. Now it could be that the right way to achieve that is to have the implementation and test code always use llvm-libc internal header paths of a certain sort, and then each of those headers is doing the right thing to use either a system header or an llvm-libc-supplied header depending on the build situation. Maybe that's even already the way it works. But we need to be sure before applying this kind of "correctness" change.

@michaelrj-google
Copy link
Contributor

I think the restrict system headers check should probably be removed at this point. There are too many cases where we do actually need to include system header (such as what's mentioned above).

It's important for overlay mode that we include the system's definitions of various structs, such as for fenv or epoll_wait. In fullbuild mode our headers will be used regardless of how we include them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants