(19-05-2025, 04:02 PM)misra cpp Wrote: Firstly, the prohibition on std:: strerror was intentional. std:: strerror may not use errno, but can still lead to undefined behaviour.
It was not intended that the rational should be taken an an exhaustive description of issues with all 37 string functions in these headers, rather than an overview.
We could make the rationale more vague, which probably wouldn't help anyone, or make it specify the issues with each of the 37 functions individually. This would make the rationale much much larger for little practical benefit.
Thanks for the clarification! I don't think it's necessary to have a description of all 37 functions, since most of them suffer from the same problems. But std:: strerror is entirely different, it just so happens to be in the same header file as others. I think it would have fit better into a separate rule, possibly next to 22.4.1. This would allow for elaborating on the specific issues of std:: strerror.
For example, it's unclear if ":: strerror_r" would be an acceptable replacement for std:: strerror, or if also that would be banned by MISRA.