5 ms·
At work we have a program that uses the exit code to encode three enums. Each digit of the decimal representation of the exit code corresponds to one of these e
by wwright 6y ago
At work we have a program that uses the exit code to encode three enums. Each digit of the decimal representation of the exit code corresponds to one of these enums.
It’s some of the most cursed code I’ve ever worked with.
(God bless anyone who ever used this program and got a set fault or sigint or sighup and therefore a bizarre result.)
- etaioinshrdlu 6y agoThat is a very bad design. Especially since you have only one byte to work with. What is the decimal range of values used?
- wwright 6y agoI think 11 to 200, but it’s not surjective
- samatman 6y agoI was horrified by your post, because I've had to deal with load-bearing exit codes. Then, I read the part about each digit of the decimal representation. Now I may need to lie down for a spell.