You can implement the reentrant version of this function by changing the prototype of the function. This listing provides storage for the output string
通过修改函数的原型,您可以实现这个函数的可重入版本。
Ensuring guideline 3 requires the compiler to have prior knowledge of all the reentrant functions, including the libraries used by the application.
确保準则3得到满足,要求编译器预先知道所有可重入函数,包括应用程序所使用的程序库。
To make it reentrant, the static data, the index variable, needs to be maintained by the caller. The reentrant version of the function could be implemented like this.
为了让它可重入,静态数据,即index,需要由调用者来维护。
I would like to propose a model for dealing with reentrant functions at the compiler level.
我将提出一个在编译器层次处理可重入函数的模型。
Things become even more complicated when you're using a third-party library, because you never know which parts of the library are reentrant and which are not.