4 ms·
Just use a more defined language than C..
by eru 11y ago
Just use a more defined language than C..
- conceit 11y agoOptimally a compiler's version of a language is better defined simply by it's definitions. It's just problematic if the behavior is changed between versions, eg. for the sake of optimizations. It's also bad if undefined behavior is expected to be reliable where the original implementation wasn't intended to be meaningful in the first place. If those two cases are hard to tell apart, the process of announcing this is at fault, I guess, e.g. the error messages and warnings, the documentation, the info hidden in discussions on the mailinglists or in bug reports, but the gcc docs seem fairly extensive and I can't claim to have read it completely or the c standard.
- ScottBurson 11y agoYes. I think, if I had to do embedded work, I would use Ada.
- eru 11y agoOr even use an explicit C-like dialect that defines more things, if you like the syntax.
- klibertp 11y agoI immediately thought about the same language. It's clean, safe, fast and explicit, even if a bit verbose. With a quite nice compiler, last time I checked (some 10 years ago), and without "undefined behaviour".