HomeFreeBSD

[libm] Avoid left shift of signed integer entities

Description

[libm] Avoid left shift of signed integer entities

Follow-up commit d180086e6eae by fixing the left shift of signed integer
entities through the use of a helper function. Specific per file changes
are:

  • lib/msun/src/e_fmodf.c:
  • lib/msun/src/s_remquof.c: . Eliminate now unused variable 'i'. . Sort declaration statement. . Use subnormal_ilogbf() to avoid left shift of signed integer.
  • lib/msun/src/math_private.h b/lib/msun/src/math_private.h: . Implement subnormal_ilogbf() to extract an exponent of a subnormal float. This avoids left shifts of signed integers. . Update nearby comment.
  • lib/msun/src/s_ilogbf.c . Fix declaration of the function statement in accordance with style(9). . Use subnormal_ilogbf() to avoid left shift of signed integer.

PR: 288850
MFC after: 1 week

Details

Provenance
Steve Kargl <kargl@FreeBSD.org>Authored on Aug 14 2025, 6:38 PM
dimCommitted on Aug 14 2025, 6:38 PM
Parents
rGb1afa460f84e: libutil++: Move to the utilities package
Branches
Unknown
Tags
Unknown