Page MenuHomeFreeBSD

fix set but not used warnings
AbandonedPublic

Authored by mmacy on May 19 2018, 2:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 5 2024, 4:48 AM
Unknown Object (File)
Dec 23 2023, 3:12 AM
Unknown Object (File)
Nov 10 2023, 6:39 AM
Unknown Object (File)
Nov 7 2023, 2:28 AM
Unknown Object (File)
Nov 6 2023, 9:39 AM
Unknown Object (File)
Nov 5 2023, 11:30 AM
Unknown Object (File)
Nov 5 2023, 1:56 AM
Unknown Object (File)
Nov 3 2023, 2:30 AM
Subscribers

Details

Reviewers
jeff
jmg
cem
Summary

gcc8 has introduced the set but not used warning which is useful for identifying dead code. unfortunately a lot of temporaries used only by INVARIANTS show up as dead code as well.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 16692

Event Timeline

remove pidctrl and uipc_usrreq.c

sbruno added inline comments.
sys/kern/kern_sendfile.c
693

Is this a bug fix?

sys/kern/subr_capability.c
52

Does this turn on INVARIANTS or turn it off or undef INVARIANTS?

sys/kern/subr_uio.c
278 ↗(On Diff #42721)

Huh ... I'm not familiar with this code, is this an actual bug fix?

sys/kern/uipc_sockbuf.c
463 ↗(On Diff #42721)

This looks like a bugfix too?

sys/kern/vfs_cache.c
755 ↗(On Diff #42721)

Huh, this looks like a potential bugfix too.

1352 ↗(On Diff #42721)

Ugh, is this a bugfix too?

sys/kern/vfs_subr.c
1408

Because of the #if 0 that is being wrapped around the use of error here, should this be updated with a #if 0 and have the getnewvnode_wait() wrapped in a #if 0?

sys/kern/subr_uio.c
278 ↗(On Diff #42721)

no just gcc thinking that uio->uio_segflg could change somehow

sys/kern/uipc_sockbuf.c
463 ↗(On Diff #42721)

In principle we'll never get an invalid command. So tough call.

sys/kern/vfs_cache.c
755 ↗(On Diff #42721)

Yes.

1352 ↗(On Diff #42721)

Yes.

sys/kern/vfs_subr.c
1408

That occurred to me but seemed gross.

sys/kern/subr_capability.c
52

It enables all the things that are under ifdef INVARIANTS when this code is compiled for user (!_KERNEL)

  • fix whitespace
  • add DBGSET macro to conditionally assign