Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark usage function as __dead2 in programs where it does not return #735

Closed
wants to merge 1 commit into from

Conversation

AtariDreams
Copy link
Contributor

In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Yes, all cases were checked.

Copy link
Member

@delphij delphij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@ngie-eign
Copy link
Contributor

Please change the email address to a non-users.noreply.github.com based address.
If you use git config user.email, etc, then run git commit --reset-author --amend, it will update the authorship appropriately.

@AtariDreams AtariDreams requested a review from bsdimp as a code owner June 11, 2023 18:15
@AtariDreams AtariDreams requested a review from delphij June 11, 2023 19:31
@AtariDreams AtariDreams changed the title Mark usage as __dead2 Mark usage function as __dead2 where it does not return Jun 11, 2023
@AtariDreams AtariDreams changed the title Mark usage function as __dead2 where it does not return Mark usage function as __dead2 in programs where it does not return Jun 11, 2023
In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Yes, all cases were checked.
@bsdimp
Copy link
Member

bsdimp commented Jun 27, 2023

So what does this offer over and above the _Noreturn marker for exit()? In the past we've not added this to the entire call tree that doesn't return, just the leaves, which the compiler can then infer is no-return... Help me understand what benefit there is here.

@bsdimp bsdimp self-assigned this Jun 27, 2023
@AtariDreams
Copy link
Contributor Author

So what does this offer over and above the _Noreturn marker for exit()? In the past we've not added this to the entire call tree that doesn't return, just the leaves, which the compiler can then infer is no-return... Help me understand what benefit there is here.

For consistency with the other functions already marked as dead2

@bsdimp
Copy link
Member

bsdimp commented Jul 7, 2023

OK. That makes sense. Most of the current ones don't really need that since the compiler can guess.
Consistency is good. _Noreturn is the new standard for this stuff, but it's likely not worth it to do that here.

@bsdimp
Copy link
Member

bsdimp commented Jul 7, 2023

landed. But for next time:
Break changes up into smaller chunks. I broke this into 15 changes with 10-25 files each.
Also had to fix the commit message to be < 80 characters.

@bsdimp bsdimp closed this Jul 7, 2023
@bsdimp bsdimp added the merged label Jul 7, 2023
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
freebsd-git pushed a commit that referenced this pull request Jul 7, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
bsdjhb pushed a commit to bsdjhb/cheribsd that referenced this pull request Sep 2, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
freebsd-git pushed a commit that referenced this pull request Sep 14, 2023
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: #735

(cherry picked from commit cccdaf5)
cschuber pushed a commit to cschuber/freebsd-fdisk that referenced this pull request Jan 25, 2024
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
cschuber pushed a commit to cschuber/freebsd-routed that referenced this pull request Apr 16, 2024
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
cschuber pushed a commit to cschuber/freebsd-routed that referenced this pull request Apr 16, 2024
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#735
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants