Page MenuHomeFreeBSD

tzcode: Silence warnings.
ClosedPublic

Authored by des on Jan 13 2023, 3:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 10 2024, 6:46 PM
Unknown Object (File)
Mar 10 2024, 6:46 PM
Unknown Object (File)
Mar 10 2024, 6:46 PM
Unknown Object (File)
Mar 7 2024, 8:58 PM
Unknown Object (File)
Dec 20 2023, 7:21 AM
Unknown Object (File)
Dec 12 2023, 10:43 AM
Unknown Object (File)
Dec 1 2023, 10:11 AM
Unknown Object (File)
Dec 1 2023, 10:11 AM
Subscribers

Details

Summary
  • Ignore failure to remove our temp file.
  • Avoid a minor memory leak in the -D case.

Reported by: Coverity (CID 1502534, 1502535, 1502538)
MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

A better commit message would be useful here. Why do you need to ignore the return value from remove?

This revision is now accepted and ready to land.Jan 13 2023, 4:36 PM
In D38038#864275, @imp wrote:

A better commit message would be useful here. Why do you need to ignore the return value from remove?

Not entirely sure what you're asking here. If you're asking why I added the (void): to shut Coverity up. If you're asking why Coverity is complaining: because it has a rule that the result of file system operations must be checked. If you're asking why none of this matters: because what we're removing here is our temporary file and we don't really care if we fail.

In D38038#864285, @des wrote:
In D38038#864275, @imp wrote:

A better commit message would be useful here. Why do you need to ignore the return value from remove?

Not entirely sure what you're asking here. If you're asking why I added the (void): to shut Coverity up. If you're asking why Coverity is complaining: because it has a rule that the result of file system operations must be checked. If you're asking why none of this matters: because what we're removing here is our temporary file and we don't really care if we fail.

The last one: We're trying remove our temp file, but it doesn't matter if it fails in the places we ignore. So, I'm suggesting that you add that to the commit message to capture more of the 'why' behind this commit.

I'm suggesting that you add that to the commit message to capture more of the 'why' behind this commit.

If this is warranted then I think a comment in the src is better than the commit message.

I'm suggesting that you add that to the commit message to capture more of the 'why' behind this commit.

If this is warranted then I think a comment in the src is better than the commit message.

Yea, but right now the commit message is an unhelpful "Silence warnings" without providing a larger context. And the commit, except for the moving of Dflag, just tosses some (void) casts on some functions without explanation of why that's OK. A sentence that says this is OK in the commit message is a fine ask, imho, though a comment would be good too... We rarely add (void) casts these days since Coverity is the only tool that likes to complain about ignoring return values though... So that's my thinking behind my comments..

des edited the summary of this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.