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
F86067856: D39593.diff
Fri, Jun 14, 10:49 PM
Unknown Object (File)
Jan 14 2024, 6:56 AM
Unknown Object (File)
Jan 2 2024, 4:10 PM
Unknown Object (File)
Dec 20 2023, 3:04 AM
Unknown Object (File)
Aug 8 2023, 8:53 PM
Unknown Object (File)
Aug 8 2023, 8:51 PM
Unknown Object (File)
Aug 8 2023, 8:51 PM
Unknown Object (File)
Aug 5 2023, 8:52 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.