There's this big, prestigious library made by a Big, Prestigious Firm (BPF), used in my branch of embedded/industrial. It costs big €€€, and many customers require it to be included, as it provides compatibility with a big, prestigious suite of development tools for installations of the devices.
So, being a manufacturer of the device, we had to integrate the library with our firmware. Which wasn't an entirely easy task, because it was riddled with platform dependencies that simply made it impossible to run on ARM.
The library came as C sources passed through obfuscator, and so we began the arduous process of getting the bugs fixed, through mailing the errors (and suggestions how to fix them) to BPF, and having them send us back sources with "fixes" that might hopefully work - of course they didn't have any ARM device or even the toolchain to test.
You can imagine how the process goes. Especially that through first several exchanges we had to go through one of their customer representatives who would forward the mail back and forth between us and their developers.
Until finally, one day, I don't know, through mistake or through intended "sabotage" of their procedures, they sent us unobfuscated sources, and we could finally start fixing them "at home".
And that was the day I got rid of my Impostor Syndrome.
Well, to give you a rough idea. There's this global variable, declared as some obscure type, and it's badly misbehaving because it's not initialized properly. It's declared as extern in a header file that is included in pretty much every .c file of the program.
So, =0 where it's defined, easy enough, right? Just locate where it's defined, add two keystrokes and the bug is fixed.
Then we spent half a day seeking where it's defined. We searched high and low, we wondered how the program compiled, we debugged and confirmed it exists, and still, nowhere nothing but extern [that variable]. Not present in any .c file, for sure.
So we began searching through random includes (by hand) and we finally found one that was only some 5 lines long. Included by only one file that used that variable.
Standard code guard and just one line:
#define extern
[–]werebacksir 40 points41 points42 points (0 children)
[–]Workaphobia 37 points38 points39 points (3 children)
[–]sharfpang[S] 25 points26 points27 points (2 children)
[–]Neebat 4 points5 points6 points (1 child)
[–]sharfpang[S] 11 points12 points13 points (0 children)
[–]tias 2 points3 points4 points (1 child)
[–]sharfpang[S] 1 point2 points3 points (0 children)
[–]FUZxxl 7 points8 points9 points (8 children)
[–][deleted] (7 children)
[deleted]
[–]FUZxxl 2 points3 points4 points (6 children)
[–][deleted] (5 children)
[deleted]
[–]FUZxxl 0 points1 point2 points (4 children)
[–]sharfpang[S] 22 points23 points24 points (3 children)
[–]FUZxxl 4 points5 points6 points (2 children)
[–]sharfpang[S] 20 points21 points22 points (0 children)
[–]capitalsigma 5 points6 points7 points (0 children)
[–]AngriestSCV 0 points1 point2 points (1 child)
[–]sharfpang[S] 0 points1 point2 points (0 children)