805
submitted 11 months ago by LolaCat@lemmy.ca to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] sonymegadrive@feddit.uk 2 points 11 months ago

Does this compile with -Wall -Werror? (might not be an option if your dependencies’ headers contain warnings)

Looks like it may be embedded code for a SoC or similar. The only things I can think of is that the tool chain you’re using maybe non-standard… or you’re invoking the dreaded Undefined Behaviour somewhere :(

[-] qaz@lemmy.world 1 points 11 months ago* (last edited 11 months ago)

I didn’t use -Werror but no warning about it showed up either. The project uses a semi-custom toolchain for a microcontroller, but I’m not using it to compile this code. I have another file with an entrypoint which tests some classes to be used by the microcontroller. The EEPROM in the code example is actually a macro for a class I’ve written that emulates the EEPROM library by writing and reading to a file on disk.

It’s a bit of a mess but this dual toolchain setup seemed easier than emulating the board and peripherals in it’s entirety. I might have to retry that though using Wokwi.

this post was submitted on 13 Oct 2023
805 points (93.5% liked)

Programmer Humor

32024 readers
1512 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS