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
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libc/src/__support/FPUtil/FEnvImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion libc/src/__support/FPUtil/aarch64/FEnvImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -17,7 +19,6 @@
#endif

#include <arm_acle.h>
#include <fenv.h>
#include <stdint.h>

#include "src/__support/FPUtil/FPBits.h"
Expand Down
3 changes: 2 additions & 1 deletion libc/src/__support/FPUtil/arm/FEnvImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion libc/src/__support/FPUtil/riscv/FEnvImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions libc/src/__support/FPUtil/rounding_mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion libc/src/__support/FPUtil/x86_64/FEnvImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
#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"

#if !defined(LIBC_TARGET_ARCH_IS_X86)
#error "Invalid include"
#endif

#include <fenv.h>
#include <stdint.h>

#include "src/__support/macros/sanitizer.h"
Expand Down
2 changes: 1 addition & 1 deletion libc/src/fenv/fegetenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
3 changes: 1 addition & 2 deletions libc/src/fenv/fegetexceptflag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
//===----------------------------------------------------------------------===//

#include "src/fenv/fegetexceptflag.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, fegetexceptflag, (fexcept_t * flagp, int excepts)) {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/fenv/fegetexceptflag.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
5 changes: 3 additions & 2 deletions libc/src/fenv/feholdexcept.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/fenv/feholdexcept.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion libc/src/fenv/fesetenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
5 changes: 3 additions & 2 deletions libc/src/fenv/fesetexceptflag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion libc/src/fenv/fesetexceptflag.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
4 changes: 2 additions & 2 deletions libc/src/fenv/feupdateenv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//

#include "src/fenv/feupdateenv.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, feupdateenv, (const fenv_t *envp)) {
Expand Down
2 changes: 1 addition & 1 deletion libc/src/fenv/feupdateenv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down