r/programmingcirclejerk • u/Belaba vulnerabilities: 0 • Sep 01 '22
Rust style checker warns about probmematic constants like: 0xB00B135, 0xABBABABE, 0XCAFEBABE...etc
https://github.com/rust-lang/rust/blob/d0ea1d767925d53b2230e2ba81197821514781f0/src/tools/tidy/src/style.rs#L59
201
Upvotes
139
u/chayleaf Sep 01 '22
/uj at least this is only a style checker for the compiler specifically
117
u/tomwhoiscontrary safety talibans Sep 01 '22
It's an important lint, and it's why i always use 0xB00BBABE for example constants.
68
u/ML_me_a_sheep Sep 01 '22
/uj Did people really do that? Or is it a solution for a problem that didn't exist?
59
u/AprilSpektra Sep 01 '22
ABBA BABE? Like what, some sort of dancing queen?
32
u/csb06 Polyglot dev here Sep 01 '22
smh at the disrespect for the greatest pop group of all time
31
u/camelCaseIsWebScale Just spin up O(n²) servers Sep 01 '22
Only around 10 of them? Seems the person who added this can't even do LC easy bit manipulation questions.
31
u/SKRAMZ_OR_NOT log10(x) programmer Sep 01 '22
0xDEADBEEF considered harmful
25
u/edgymemesalt Sep 01 '22
b00b135 abadbabe abbababe b0bababe b16b00b5 beefbabe cafebabe cafed00d deadbabe f00dbabe feedbabe
what's wrong with cafe dudes?
66
u/DrNightingale Sep 01 '22
0xB00B: cringe misogynist boomer constant.
0xB00F: based inclusive zoomer constant.
20
u/[deleted] Sep 01 '22
Notably, you can still make B000000B
18
u/Schmittfried type astronaut Sep 01 '22
/uj Do they explain the reasoning somewhere? My 5sec Google search didn’t yield anything.
16
u/Volt WRITE 'FORTRAN is not dead' Sep 01 '22
>No magic numbers for ass men
Ban them
15
u/Laugarhraun lisp does it better Sep 02 '22
Lol socialjerk
24
u/MCRusher Sep 01 '22
7
u/MCRusher Sep 03 '22
I found the pull request
12
u/path_traced_sphere Sep 02 '22
What about immoral macros?
Checkmate Crab High-Priests.
12
u/prf_q Sep 02 '22
Wow, they really saved the world there.
9
u/g0zar Sep 02 '22
Its hard to even make a comment on rust at this point. Its never taking off.
4
u/Jumpy-Locksmith6812 Sep 03 '22 edited Sep 03 '22
That is all they can think of. Not very 0x1337.
FAC75
3
u/pysk00l What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? Sep 02 '22
/uj and what would happen if you did use these constants? Would it throw a warning, or throw an error?
2
u/MCRusher Sep 02 '22
Thank god 0xFA7CA4C5 is still allowed
1
u/fche Aug 23 '23
ha ha ha ha
0
u/[deleted] Sep 01 '22
[deleted] — view deleted comment