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)
Thu, Jan 23, 6:39 PM
Unknown Object (File)
Thu, Jan 23, 6:25 PM
Unknown Object (File)
Dec 11 2024, 11:34 AM
Unknown Object (File)
Dec 4 2024, 5:55 AM
Unknown Object (File)
Nov 19 2024, 8:45 PM
Unknown Object (File)
Nov 16 2024, 3:38 PM
Unknown Object (File)
Nov 16 2024, 1:44 PM
Unknown Object (File)
Nov 2 2024, 5:40 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.