-
-
Notifications
You must be signed in to change notification settings - Fork 327
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
Use #[expect(…)] instead of #[allow(…)], remove unnecessary allows #2784
Use #[expect(…)] instead of #[allow(…)], remove unnecessary allows #2784
Conversation
Feel free to fix this for all build targets - but it might be a world of pain :) |
I did some more, but I'll leave the rest to someone else. |
Also: I cannot guarantee that I haven't broken anything. I've manually checked as much as possible and the CI found stuff as well, but I may have still missed some cfg-dependent stuff (there's a lot in there lol). On the upside, I've only touched linting-related things. So if anyone's computer starts complaining, it's easy to just re-add the warning or change it back from an |
|
||
# start manager in background, then start one client | ||
timeout 32s ./${FUZZER_NAME} --cores 0 --input ./corpus 2>/dev/null & | ||
timeout 31s ./${FUZZER_NAME} --cores 1 --input ./corpus | tee fuzz_stdout.log 2>/dev/null || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this, otherwise the test doesn't pass. Doesn't either on main btw.
And a few other very small tidbits here and there. Just tidying things with as little change to the logic as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird, how was this not caught before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it still not work now that you fixed the Opt parser btw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted the change. Most likely something to do with the unwanted code changes. No idea what happened there lol.
@@ -83,6 +83,7 @@ pub fn main() { | |||
}; | |||
|
|||
// Create an observation channel using the signals map | |||
#[allow(static_mut_refs)] // only a problem in nightly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not use static mut refs here.
See this discussion as reference
#2770 (comment)
This is cool! I'm a bit afraid we'll run into a bunch of new errors on odd platforms though |
|
|
The pendantic comment you can ignore |
Both are already in the repo. This makes them just a bit more visible. I need to do something else at some point. Separate PR please? |
Ah you already didn't :D |
As in: the maximum amount of enabled lint possible at all times; without being ridicoulous |
@@ -24,14 +24,15 @@ use libafl_bolts::{current_nanos, nonzero, rands::StdRand, tuples::tuple_list, A | |||
|
|||
/// Coverage map with explicit assignments due to the lack of instrumentation | |||
static mut SIGNALS: [u8; 16] = [0; 16]; | |||
#[allow(static_mut_refs)] // only a problem in nightly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case these allows have to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or otherwise leave a biiiiiig TODO comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created an issue (#2786) and added a comment to the code with a link to it.
Who needs to graduate anyways… |
@devnexen if you ever find the time, it'd be interesting if this breaks something on obscure *Nixes |
Ok, will do ! |
|
Thank you @devnexen ! :) |
#[expect(…)]
returns a lint warning (configured to be an error) if the lint warning is not present without the attribute.This also means I was able to remove a lot of
allow
statements.I suggest in the future,
expect
is used wherever possible. The only exceptions I've stumbled across are when they are used in a macro and only appear for some macro calls (thinktrivial_numeric_casts
of au64
to a type passed to the struct, and it is called foru64
among others) and if the warning only appears in certain cfgs.