Closed demiaowu closed 7 years ago
@demiaowu Thanks for your pull request, but it seems failed to compile on other versions compiler.
@zd-double 编译错误是预期;还需要将当前安装sofa-pbrpc的机器下的C++ sstream
头文件覆盖 sofa-pbrpc/unit_test/sstream/sstream,然后将struct __xfer_bufptrs
修改为显示的声明private
。因为考虑到不同版本的gcc,不一定会存在这个问题(新版本会有这个问题),上述修改过程很难用脚本实现,所以只能手动修改,不然就会触发编译错误。而且参考:https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65899 ,gcc官方好像没有意愿修复这个问题——But I'm not interested in supporting -Dprivate=public, it's just wrong.
,所以建议了此解决方案,但需要在wiki unit_test 构建指南中指出。Thanks~
我理解在单测的Makefile中直接用 -fno-access-control
替换 -Dprivate=public
就可以了
@cyshi 对,我刚开始想当然了(以为只是编译器忽略了访问权限检查,但运行期会报错),修正了重新提了。参见 #164 @zd-double 。Thanks~
fix the Issue #150 .
While using the parameter
-Dprivate=public
of g++ in the unit_test module, it result in the confict with the header file ofsstream
in the gcc 6.2.0 . Much more detail information can be get at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65899. I copy a newsstream
file for the unit_test module only. For thesstream
, I just add theprivate:
to explicit declare the memberstruct __xfer_bufptrs
to make it consistency while using-Dprivate=public
for unit test. Note that you must copy thesstream
file in your cpp's include directory to cover the ./sofa-pbrpc/unit_test/sstream/sstream, then find the declare of the memberstruct __xfer_bufptrs
, if it is implicitly private when it's declared, you must explicitly declare it as private. Accordingly, the build guide ofunit_test
in the wiki should be modified.Thanks.