Liste des Groupes |
In article <2024Aug31.170347@mips.complang.tuwien.ac.at>,But surely you would discover that before using the std::string type? I might do some quick test code using "stuff copied off the internet", but for any serious programming I would want to read the specifications of a type or function before using it. That's the only way to be sure you are writing correct code.
anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote:
Undefined behaviour is something that is exercised at run-time.That's among the many reasons why there is no single way "to make code
That's why the "undefined behaviour sanitizers" insert run-time
checks. And of course they only detect the behaviour when it is
actually exercised. I.e., they usually will not detect overflowable
buffers, because your usual test inputs don't exercise those.
secure." For string buffers, you turn on the compiler run-time checks,
and use the length-checking versions of string handling functions. Then
you write tests to check both of those are actually working.
Then you discover that the C++ string[] operator is not bounds-checked,
as per the C++ standard, but string.at() is bounds-checked, and curse a
bit.
Les messages affichés proviennent d'usenet.