如何编译C程序不使用任何优化 [英] How to compile C program without any optimization

查看:104
本文介绍了如何编译C程序不使用任何优化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何编译C程序,而无需使用经过任何优化的gcc / g ++的?


解决方案

  GCC的main.c

  G ++的main.cpp

在默认情况下它不会做任何优化。只有当你指定 -O1,-O2,-O3等... 它做优化。

或者你也可以使用 -O0 开关,使之明确。

How can I compile a C program without undergoing any optimizations using gcc/g++?

解决方案

gcc main.c

or

g++ main.cpp

by default it doesn't do any optimizations. Only when you specify -O1, -O2, -O3, etc... does it do optimizations.

Or you can use the -O0 switch to make it explicit.

这篇关于如何编译C程序不使用任何优化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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