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)
Mon, Feb 2, 10:02 PM
Unknown Object (File)
Sat, Jan 31, 1:41 AM
Unknown Object (File)
Dec 12 2025, 11:31 PM
Unknown Object (File)
Nov 22 2025, 3:10 PM
Unknown Object (File)
Nov 20 2025, 12:47 PM
Unknown Object (File)
Oct 11 2025, 3:43 AM
Unknown Object (File)
Oct 11 2025, 3:43 AM
Unknown Object (File)
Oct 11 2025, 3:43 AM
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.