Earlier quoted context omitted.
Not my experience. I work with a -fno-exceptions codebase. Still quite a lot of std left. (Exceptions come with a surprisingly hefty binary size cost.)
Not exactly sure what your experience is, but if you work with in an -fno-exceptions codebase then you know that STL containers are not usable in that regime (with the exception of std::tuple it seems, see freestanding comment below). I would argue that the majority of use cases of the STL is for its containers. So, what exact parts of the STL do you use in your code base? Most be mostly compile time stuff (types, ty…
The C++ standard for the F-35 Fighter Jet [video]
91–100 of 451 posts
Re: The C++ standard for the F-35 Fighter Jet [video]
#92Earlier quoted context omitted.
Especially since there is a widely recognized way to ignore a parameter: (void) a; Every C programmer beyond weaning knows that.
The point really was that the unused method parameter should in almost all cases be removed, not that some trick should be used to make it seem used, and this is the wrong trick!
Re: The C++ standard for the F-35 Fighter Jet [video]
#93Earlier quoted context omitted.
You’re joking right? That autogenerated code is generally garbage and spaghetti code. It was probably the reason for Toyotas unintended acceleration glitch.
Modern autogenerated C code from Simulink is rather effective. It is neither garbage nor spaghetti, it is just... peculiar.
Re: The C++ standard for the F-35 Fighter Jet [video]
#94a = a; // misra Actual code i have seen with my own eyes. (Not in F-35 code) Its a way to avoid removing an unused parameter from a method. Unused parameters are disallowed, but this is fine? I am sceptical that these coding standards make for good code!
Re: The C++ standard for the F-35 Fighter Jet [video]
#95TL;DR - no exceptions - no recursion - no malloc()/free() in the inner-loop
Forbidding recursion is pretty annoying. One of the nice things that's on the distant horizon for Rust is an explicit tail recursion operator perhaps named `become`. Unlike naive recursion, which as this video (I haven't followed the link but I'm assuming it is Laurie's recent video) explains risks stack overflow, optimized tail recursion doesn't grow the stack. The idea of `become` is to signal "I believe this can b…
Re: The C++ standard for the F-35 Fighter Jet [video]
#96a = a; // misra Actual code i have seen with my own eyes. (Not in F-35 code) Its a way to avoid removing an unused parameter from a method. Unused parameters are disallowed, but this is fine? I am sceptical that these coding standards make for good code!
Notably this document is from 2005. So that's after C++ was standardized but before their second bite of that particular cherry and twenty years before its author, Bjarne Stroustrup suddenly decides after years of insisting that C++ dialects are a terrible idea and will never be endorsed by the language committee, that in fact dialects (now named "profiles") are the magic ingredient to fix the festering problems with the language.
While Laurie's video is fun, I too am sceptical about the value of style guides, which is what these are. "TABS shall be avoided" or "Letters in function names shall be lowercase" isn't because somebody's aeroplane fell out of the sky - it's due to using a style Bjarne doesn't like.
Re: The C++ standard for the F-35 Fighter Jet [video]
#97TL;DR - no exceptions - no recursion - no malloc()/free() in the inner-loop
At that point, why not write in C? Do they think it's C/C++ and not understand the difference? > no recursion Does this actually mean no recursion or does it just mean to limit stack use? Because processing a tree, for example, is recursive even if you use an array, for example, instead of the stack to keep track of your progress. The real trick is limiting memory consumption, which requires limiting input size.
Re: The C++ standard for the F-35 Fighter Jet [video]
#98TL;DR - no exceptions - no recursion - no malloc()/free() in the inner-loop
Re: The C++ standard for the F-35 Fighter Jet [video]
#99The same is true for the software that runs many satellites. Use of the STL is prohibited. The main issue is mission assurance. Using the stack or the heap means your variables aren't always at the same memory address. This can be bad if a particular memory cell has failed. If every variable has a fixed address, and one of those addresses goes bad, a patch can be loaded to move that address and the mission can contin…
Re: The C++ standard for the F-35 Fighter Jet [video]
#100Earlier quoted context omitted.
> It was probably the reason for Toyotas unintended acceleration glitch. Do you have any evidence for "probably"?
I know for the fact simulink generates spaghetti and spaghetti code was partially blamed for Toyotas problems. Hence the inference See https://www.safetyresearch.net/toyota-unintended-acceleratio...
"I know for a fact that Italian cooks generate spaghetti, and the deceased's last meal contained spaghetti, therefore an Italian chef must have poisoned him"