3 ms·
This was the cause of my very first "hard" C Bug, in 1991 or so. I had written a program in our Novell Netware labs to read in the printer control code definit
by ghshephard 12y ago
This was the cause of my very first "hard" C Bug, in 1991 or so. I had written a program in our Novell Netware labs to read in the printer control code definitions for our printer-release consoles - being "clever", and wanting to save a few lines of code, I read them into a memory structure, and overlaid a C-Struct on top of them that mapped precisely to the fields that I wanted. Everything worked fine, code compiled, and we were able to read all the job definitions until I handed it off to the team responsible for the rest of the release console - at which point the code just started breaking. No longer worked. For the life of me I couldn't figure out what was going, until our team leader took a glance, and made it clear that I needed to inform the compiler to byte align the C Structs (which was likely the default behavior in Turbo-C, but not Watcom C).
Really opened my eyes to the many, many things that I didn't know.