Skip to content

Conversation

@fxysunshine
Copy link
Contributor

@fxysunshine fxysunshine commented Jan 19, 2026

Summary

This pull request contains two compile warning in openlibm:

  1. Patch 5266499/2: openlibm/src/k_rem_pio2.c:421:24: error: 'fq' may be used uninitialized
  • error: 'fq' may be used uninitialized [-Werror=maybe-uninitialized]
  1. Patch 5333599/1: Building openlibm on x86_64 triggers two types of compile warnings:
  • attribute-alias: Incompatible type alias between clog and clogl functions (s_clog.c:78:33)
  • shadow: Declaration of feclearexcept/fegetexceptflag shadows built-in functions (fenv_amd64.h:99:1, 117:1)

These patches have been validated internally and are ready for upstream integration.

Impact

  • Compatibility: Maintains backward compatibility with existing code
  • Functionality: No change to the behavior of math functions or FPU exception handling; the warnings are false positives caused by openlibm's compatibility layer.
  • Scope: Only affects the compilation process of the openlibm library; no runtime impact on library functionality or performance.
  • Compatibility: No breaking changes to other modules or architectures; the new flag is compatible with all supported toolchains (GCC/clang).
  • Toolchain: Valid for GCC toolchains; no impact on clang builds (the flags are ignored if not supported).

Testing

✅ Build successful
✅ System boots correctly
✅ Core functionality verified
✅ No regressions detected

Verification Checklist

  • Code compiles without warnings
  • No new issues introduced
  • x86_64 openlibm build completes without attribute-alias and shadow warnings.
  • FPU exception handling functions (feclearexcept, fegetexceptflag) work correctly.
  • Cross-architecture builds (ARM/RISC-V) are error-free.
  • No performance degradation in floating-point operations.

Building C object libs/libm/openlibm/CMakeFiles/m.dir/openlibm/src/s_clog.c.obj
In file included from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/math_private.h:22,
                 from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/s_clog.c:61:
/work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/s_clog.c:78:33: warning: ‘clogl’ alias between functions of incompatible types ‘_Complex long double(_Complex long double)’ and ‘_Complex double(_Complex double)’ [-Wattribute-alias=]
   78 | openlibm_strong_reference(clog, clogl);
      |                                 ^~~~~
/work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/cdefs-compat.h:24:50: note: in definition of macro ‘openlibm_strong_reference’
   24 |         OLM_DLLEXPORT extern __typeof (aliassym) aliassym __attribute__ ((__alias__ (#sym)));
      |                                                  ^~~~~~~~
/work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/s_clog.c:64:1: note: aliased declaration here
   64 | clog(double complex z)

Building C object libs/libm/openlibm/CMakeFiles/m.dir/openlibm/amd64/fenv.c.obj
In file included from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/include/openlibm_fenv.h:8,
                 from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/amd64/fenv.c:35:
/work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/include/openlibm_fenv_amd64.h:99:1: warning: declaration of ‘feclearexcept’ shadows a built-in function [-Wshadow]
   99 | feclearexcept(int __excepts)
      | ^~~~~~~~~~~~~
/work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/include/openlibm_fenv_amd64.h:117:1: warning: declaration of ‘fegetexceptflag’ shadows a built-in function [-Wshadow]
  117 | fegetexceptflag(fexcept_t *__flagp, int __excepts)

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
@github-actions github-actions bot added Area: OS Components OS Components issues Size: XS The size of the change in this PR is very small labels Jan 19, 2026
nuttx/libs/libm/openlibm/openlibm/src/k_rem_pio2.c:421:24: error: 'fq' may be used uninitialized [-Werror=maybe-uninitialized]

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
@fxysunshine fxysunshine marked this pull request as ready for review January 19, 2026 07:41
@fxysunshine fxysunshine deleted the openlibm-cmake-fix branch January 19, 2026 08:02
@fxysunshine fxysunshine restored the openlibm-cmake-fix branch January 19, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: OS Components OS Components issues Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants