免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3170 | 回复: 1
打印 上一主题 下一主题

HPUX下使用aCC编译程序出现 error(future),如何解决? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-09-09 15:35 |只看该作者 |倒序浏览
错误信息是:
Error (future) 251: \"./das/das.cpp\", line 572 # An object cannot be deleted using a pointer of type \'void *\'
    since the type of the object allocated is unknown. Either delete the object using the allocated type or
    call operator delete directly.
        if ( tempPP != NULL )  delete []tempPP;
                                        ^^^^^^  
Warning:        1 future errors were detected and ignored. Add a \'+p\' option to detect and fix them before they become fatal errors in a future release. Behavior of this ill-formed program is not guaranteed to match that of a well-formed program

出错的程序代码是:
//释放空间
void das_free(void *tempPP){
   
    if ( tempPP != NULL )  delete []tempPP;
    return;
}

是从WINDOWS下的程序移植过来的,难道非要直接delete,不能
用这个封装的函数?如果改相关的代码的话,那么会有些麻烦,不但
我的代码要改,还要让接口另一边的同事改。有没有更好的封装形式
以避免这个error?看出错信息似乎说运行时无法真的释放指针所指
的空间。

论坛徽章:
0
2 [报告]
发表于 2004-09-09 22:55 |只看该作者

HPUX下使用aCC编译程序出现 error(future),如何解决?

查查封装的函数的原代码,看看是怎么释放的,有没有类型?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP