Page MenuHomeFreeBSD

Quiet compiler warnings for fget_noref and fdget_noref
ClosedPublic

Authored by stevek on Apr 16 2023, 12:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 2, 5:40 PM
Unknown Object (File)
Oct 17 2024, 3:31 AM
Unknown Object (File)
Oct 14 2024, 3:39 PM
Unknown Object (File)
Oct 3 2024, 5:23 PM
Unknown Object (File)
Oct 2 2024, 9:06 PM
Unknown Object (File)
Sep 27 2024, 7:33 AM
Unknown Object (File)
Sep 23 2024, 3:13 AM
Unknown Object (File)
Sep 19 2024, 7:03 PM
Subscribers

Details

Summary

Typecasting both parts of the comparison to u_int quiets compiler
warnings about signed/unsigned comparison and takes care of positive
and negative numbers for the file descriptor in a single comparison.

Obtained from: Juniper Netwowrks, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 50930
Build 47821: arc lint + arc unit

Event Timeline

fdt_nfiles should probably become unsigned instead and whatever which does not already (u_int)fd should start doing it

what compiler are you using?

This revision is now accepted and ready to land.Apr 16 2023, 12:45 AM
In D39593#901233, @mjg wrote:

fdt_nfiles should probably become unsigned instead and whatever which does not already (u_int)fd should start doing it

what compiler are you using?

Using clang. I believe it was caught by the -Wsign-compare warning.