...
【24h】

Compatibilities

机译:相容性

获取原文
获取原文并翻译 | 示例
           

摘要

Guidelines for Module Boundaries What applies to functions applies in particular to the boundary of any module (nonsource unit of release; for example, shared library, DLL, or object file), which tends to be where you have the least amount of control over perfect build agreement with all possible callers. In a module, if you want to do any of the following in an externally accessible function: 1.Mention a user-defined type in the module's external interface (for example, as a parameter public or exported API). 2. Allocate memory in the module and deallocate it outside the module, or vice versa. (See Item 60 of [1].) 3. Allow an exception to propagate out of the module to a caller. (See Item 62 of [1].) then you must be able to guarantee that the module and all of the code that will ever call it will be compiled using the same compiler and compatible compiler switch settings. Just using the same compiler isn't enough: Popular compilers can and do generate incompatible code for all three of the above if you throw different switch settings, You also have to use the same Standard Library implementation, including the same version, if any Standard Library facilities are mentioned in an externally visible functions signature or are shared outside the module.
机译:模块边界准则适用于函数的方法尤其适用于任何模块的边界(发行的非源单元;例如,共享库,DLL或目标文件),这往往使您对完美的控制最少。与所有可能的呼叫者建立协议。在模块中,如果要在外部可访问的功能中执行以下任一操作:1.在模块的外部接口中提及用户定义的类型(例如,作为参数public或export API)。 2.在模块中分配内存,然后在模块外部分配内存,反之亦然。 (请参阅[1]的项目60。)3.允许异常从模块传播到调用者。 (请参阅[1]的第62条。)那么您必须能够保证将使用相同的编译器和兼容的编译器开关设置来编译该模块以及将调用该模块的所有代码。仅使用相同的编译器是不够的:如果您抛出不同的开关设置,那么流行的编译器可以并且确实为上述三个生成不兼容的代码,还必须使用相同的标准库实现,包括相同的版本(如果有的话)库功能在外部可见的功能签名中提及,或者在模块外部共享。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号