|
Subjunctive posted:Still better than strncpy, which nobody should ever use. Why is it so bad? Is it the fact that it won't null terminate a string over the specified size the problem, or what?
|
# ¿ Feb 9, 2015 11:18 |
|
|
# ¿ May 3, 2024 00:06 |
|
Rocko Bonaparte posted:Has anybody ever considered trying to add a fake device in QEMU for integration/regression testing of drivers for the real device? I was curious how much of a thing that is. Yes, but it was a type of NVMe device, for which adding the extra tidbits/logic was pretty trivial.
|
# ¿ May 9, 2022 07:05 |
|
Ihmemies posted:Multiple people have said this so far but I still have no idea. I never spot my own mistakes and rarely learn from them so most likely this one will go into the same ever growing pile of mistakes not learned from. Put every single calculation and/or check in a separate line, catching the value in a separate variable and check it under debugger/print it. Don't use the auto keyword for the types.
|
# ¿ Nov 16, 2022 12:58 |
|
Foxfire_ posted:The main reason I think it's still around is that an optimizer being able to assume that things like "x+1 is always greater than x" is useful Why would this differ between signed and unsigned integers?
|
# ¿ Jan 3, 2023 09:36 |
|
A small nitpick/hint, but you can automatically calculate the MAX_LIMITS based on the sizeof of the limits array (since it's statically allocated). That way it's more tightly coupled with it, which is what you want (you won't have to remember to change two places at once).
|
# ¿ Jan 17, 2023 21:29 |
|
ShoulderDaemon posted:When I first started at my current employer, one of the simulators I became owner of was consistently formatted like this: How did you find my university assignments?
|
# ¿ Nov 5, 2023 20:30 |
|
Over 10 years ago, and a different country, but I did have something like that for cryptography class. Each student would get a random algorithm and needed to create a program that would encrypt/decrypt a file with a password in ECB/CBC/OFB/CFB modes. Language and library choice was up to the student. I managed to get a very niche one (MARS) that the only library I found was with a bespoke Eclipse+Java installation.
|
# ¿ Mar 24, 2024 09:35 |
|
|
# ¿ May 3, 2024 00:06 |
|
Sure? All the negatives about it were given at the lectures, but it was still a good starting point for all the clueless students for interfacing with the various libraries and designing the file format, since there were fewer parameters needed to pass along and you could debug any errors easier if you saw one block with an error instead of half the file.
|
# ¿ Mar 24, 2024 16:01 |