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, May 9, 11:07 AM
Unknown Object (File)
Fri, May 8, 6:52 PM
Unknown Object (File)
Fri, May 8, 2:00 AM
Unknown Object (File)
Thu, May 7, 12:19 PM
Unknown Object (File)
Mon, May 4, 9:21 AM
Unknown Object (File)
Sun, May 3, 6:49 PM
Unknown Object (File)
Sun, May 3, 6:58 AM
Unknown Object (File)
Apr 28 2026, 4:31 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 Not Applicable
Unit
Tests Not Applicable

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.