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

Clearer error message for unsupported flags: print names of flags (if possible) #3642

Open
tiif opened this issue May 28, 2024 · 1 comment
Labels
A-diagnostics errors and warnings emitted by miri C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@tiif
Copy link
Contributor

tiif commented May 28, 2024

The error message will be clearer if we can print the exact unsupported flag name in throw_unsup_format! message. This is mentioned in #3609 (comment)_.

For socketpair, only SOCK_DGRAM is not supported. But for other larger functions that involve a lot of flags, it will be useful if there is a helper function that keeps track of unsupported flags that we know and helps to throw error with exact name of the flag.

@RalfJung RalfJung changed the title Clearer error message for unsupported flags Clearer error message for unsupported flags: print names of flags (if possible) May 28, 2024
@RalfJung RalfJung added C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement A-diagnostics errors and warnings emitted by miri labels May 28, 2024
@RalfJung
Copy link
Member

Probably what we'd want is to be able to "decode" a flag value into NAME1 | NAME2 | NAME3, and then print that. Of course if a flag is truly unknown we can't do that and have to still show the hex value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics errors and warnings emitted by miri C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

No branches or pull requests

2 participants