Safer Alternatives to the C Standard Library

后端 未结 6 1514
广开言路
广开言路 2021-02-07 10:29

The C standard library is notoriously poor when it comes to I/O safety. Many functions have buffer overflows (gets, scanf), or can clobber memory if n

6条回答
  •  长发绾君心
    2021-02-07 11:28

    You're always at liberty to implement any library you like and to use it - the hard part is making sure it is available on the platforms you need your software to work on. You can also use wrappers around the standard functions where appropriate.

    Whether it is really a good idea is somewhat debatable, but there is TR24731 published by the C standard committee - for a safer set of C functions. There's definitely some good stuff in there. See this question: Do you use the TR 24731 Safe Functions in your C code?, which includes links to the technical report.

提交回复
热议问题