gcc的fmessage-length参数

在gnu工具链的编译过程中,遇到长错误信息导致控制台显示不完整的情况。通过添加'-fmessage-length=0'选项,可以自动根据控制台宽度使输出信息换行,确保完整查看编译错误。这一技巧对于优化开发中的问题排查至关重要。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

gnu工具链编译过程中,控制台输出的一行信息是不换行的。当输出信息过长时(如编译错误时的信息),会导致你无法看到完整的输出信息。

加入-fmessage-length=0后,输出信息会根据控制台的宽度自动换行,这样就能看全输出信息了。

mktemp -u XXXXXX 932979 test_cpp_condition stddef.h __riscv_zbb test_cpp BEGIN /tmp/ffconf.c1932982/test.c 1 #include <stddef.h> 2 #if !(__riscv_zbb) 3 #error "unsatisfied condition: __riscv_zbb" 4 #endif END /tmp/ffconf.c1932982/test.c riscv64-tizen-linux-gnu-gcc -O2 -g2 -gdwarf-4 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -Wformat-security -Wformat -fmessage-length=0 -Wno-implicit-fallthrough -Wl,-z,relro,--as-needed -feliminate-unused-debug-types -Wformat -mabi=lp64d -march=rv64gc -Wl,-O1 -Wl,--hash-style=gnu -g -Wall -g -fPIC -DTIZEN_FEATURE_FFMPEG -DDBG_GSTFFMPEG_ALONE -DENABLE_SW_TBM_VXIMAGESINK -DTIZEN_PRODUCT_TV -DDRM_MAPI_AARCH_64 -fno-lto -fPIC -march=rv64gcv_zbb -I/home/abuild/rpmbuild/BUILD/gst-ffmpeg-1.45.0.tv/gst-libs/ext/ffmpeg/fdk-aac/include -I/usr/include/libpng16 -Wl,-z,relro -E -o /tmp/ffconf.c1932982/test.o /tmp/ffconf.c1932982/test.c test_ld cc test_cc BEGIN /tmp/ffconf.c1932982/test.c 1 int main(void){ return 0; } END /tmp/ffconf.c1932982/test.c riscv64-tizen-linux-gnu-gcc -O2 -g2 -gdwarf-4 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -Wformat-security -Wformat -fmessage-length=0 -Wno-implicit-fallthrough -Wl,-z,relro,--as-needed -feliminate-unused-debug-types -Wformat -mabi=lp64d -march=rv64gc -Wl,-O1 -Wl,--hash-style=gnu -g -Wall -g -fPIC -DTIZEN_FEATURE_FFMPEG -DDBG_GSTFFMPEG_ALONE -DENABLE_SW_TBM_VXIMAGESINK -DTIZEN_PRODUCT_TV -DDRM_MAPI_AARCH_64 -fno-lto -fPIC -march=rv64gcv_zbb -I/home/abuild/rpmbuild/BUILD/gst-ffmpeg-1.45.0.tv/gst-libs/ext/ffmpeg/fdk-aac/include -I/usr/include/libpng16 -Wl,-z,relro -c -o /tmp/ffconf.c1932982/test.o /tmp/ffconf.c1932982/test.c riscv64-tizen-linux-gnu-gcc -ldl -L/home/abuild/rpmbuild/BUILD/gst-ffmpeg-1.45.0.tv/gst-libs/ext/ffmpeg/fdk-aac/lib -L/usr/lib -Wl,-z,relro,-z,now -o /tmp/ffconf.c1932982/test /tmp/ffconf.c1932982/test.o -ldl -lpng16 -lfdk-aac /usr/lib64/gcc/riscv64-tizen-linux-gnu/13.1.0/../../../../riscv64-tizen-linux
03-21
BEGIN /tmp/ffconf.W2379748/test.c 1 #include <stddef.h> 2 #if !(__riscv_zbb) 3 #error "unsatisfied condition: __riscv_zbb" 4 #endifEND /tmp/ffconf.W2379748/test.criscv64-tizen-linux-gnu-gcc -O2 -g2 -gdwarf-4 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -Wformat-security -Wformat -fmessage-length=0 -Wno-implicit-fallthrough -Wl,-z,relro,--as-needed -feliminate-unused-debug-types -Wformat -mabi=lp64d -march=rv64gc -Wl,-O1 -Wl,--hash-style=gnu -g -Wall -g -fPIC -DTIZEN_FEATURE_FFMPEG -DDBG_GSTFFMPEG_ALONE -DENABLE_SW_TBM_VXIMAGESINK -DTIZEN_PRODUCT_TV -DDRM_MAPI_AARCH_64 -fno-lto -fPIC -march=rv64gcv_zbb -I/home/abuild/rpmbuild/BUILD/gst-ffmpeg-1.45.0.tv/gst-libs/ext/ffmpeg/external_lib/include -I/usr/include/libpng16 -Wl,-z,relro -E -o /tmp/ffconf.W2379748/test.o /tmp/ffconf.W2379748/test.ctest_ld cctest_ccBEGIN /tmp/ffconf.W2379748/test.c 1 int main(void){ return 0; }END /tmp/ffconf.W2379748/test.criscv64-tizen-linux-gnu-gcc -O2 -g2 -gdwarf-4 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong -Wformat-security -Wformat -fmessage-length=0 -Wno-implicit-fallthrough -Wl,-z,relro,--as-needed -feliminate-unused-debug-types -Wformat -mabi=lp64d -march=rv64gc -Wl,-O1 -Wl,--hash-style=gnu -g -Wall -g -fPIC -DTIZEN_FEATURE_FFMPEG -DDBG_GSTFFMPEG_ALONE -DENABLE_SW_TBM_VXIMAGESINK -DTIZEN_PRODUCT_TV -DDRM_MAPI_AARCH_64 -fno-lto -fPIC -march=rv64gcv_zbb -I/home/abuild/rpmbuild/BUILD/gst-ffmpeg-1.45.0.tv/gst-libs/ext/ffmpeg/external_lib/include -I/usr/include/libpng16 -Wl,-z,relro -c -o /tmp/ffconf.W2379748/test.o /tmp/ffconf.W2379748/test.criscv64-tizen-linux-gnu-gcc -ldl -L/home/abuild/rpmbuild/BUILD/gst-ffmpeg-1.45.0.tv/gst-libs/ext/ffmpeg/external_lib/lib -L/usr/lib -Wl,-z,relro,-z,now -o /tmp/ffconf.W2379748/test /tmp/ffconf.W2379748/test.o -lpthread -ldl -lpng16 -ldav1d -lfdk-aac/usr/lib64/gcc/riscv64-tizen-linux-gnu/13.1.0/../../../../riscv64-tizen-linux-gnu/bin/ld: cannot find -ldav1d: No suc 这个问题可能是我哪个文件
03-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值