Page MenuHomeFreeBSD

tzcode: Silence warnings.
ClosedPublic

Authored by des on Jan 13 2023, 3:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 12:47 PM
Unknown Object (File)
Sep 26 2024, 10:09 PM
Unknown Object (File)
Sep 25 2024, 7:20 AM
Unknown Object (File)
Sep 23 2024, 8:46 PM
Unknown Object (File)
Sep 23 2024, 8:10 AM
Unknown Object (File)
Sep 19 2024, 9:18 PM
Unknown Object (File)
Sep 19 2024, 12:24 PM
Unknown Object (File)
Sep 19 2024, 5:37 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.