-DNDEBUG通常来自哪里? [英] Where does the -DNDEBUG normally come from?

查看:1490
本文介绍了-DNDEBUG通常来自哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的构建系统已经改变,以至于优化的构建不再将-DNDEBUG添加到编译行。我搜索我们的makefile,没有找到这个。

Our build system has somehow changed such that optimized builds are no longer getting the -DNDEBUG added to the compile line. I searched our makefiles and don't find this.

所以问题是,-DNDEBUG在哪里为大多数人发起,怎么改变?之前我们确实有-DNDEBUG,我不认为这是从我们的任何makefile中删除。

So the question is, where does -DNDEBUG originate for most people and how might that have changed? Before we did have -DNDEBUG and I don't think this was removed from any of our makefiles.

谢谢。

-William

推荐答案

由于编译器无法决定自己何时添加NDEBUG定义, ,该标志总是由makefile或项目文件设置(取决于你的构建系统)。

Since the compiler can't decide on its own when to add the NDEBUG define and when not to, the flag is always set by either the makefile or project file (depending on your build system).

这篇关于-DNDEBUG通常来自哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆