gpt4 book ai didi

c - GCC 和生成文件 : Only show errors and warnings

转载 作者:太空狗 更新时间:2023-10-29 16:39:32 24 4
gpt4 key购买 nike

我有一个 makefile 可以编译我项目中的每个 .c 文件。对于每个文件,我将整个编译命令打印到 shell 中,其中包含所有选项和标志。这是一个文件的示例输出:

arm-none-eabi-gcc -c -mcpu=cortex-m3 -O0 -dM -g -gdwarf-2 -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms=src/sim/sim_configuration.lst -include ./lib/stm32core/stm32f2xx_conf.h -I . -I./lib/ARMStandardLibrary -I./lib/LwIP -I./lib/LwIP/src/include -I./lib/LwIP/src/include -I./lib/LwIP/src/include/ipv4 -I./lib/LwIP/src/include/ipv6 -I./lib/FatFS -I./lib/stm32core -I./src -I./src/sim -I./src/sd -I./src/tftp src/sim/sim_configuration.c -o src/sim/sim_configuration.o

问题是各种警告在这一团乱七八糟的命令输出中丢失了。有没有办法打印出现的警告和错误(不是原始命令)?

最佳答案

使用-s 选项执行make。来自man page .

-s, --silent, --quiet
Silent operation; do not print the commands as they are executed.

关于c - GCC 和生成文件 : Only show errors and warnings,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11956518/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com