海湾合作委员会,使:如何禁用失败警告? [英] gcc, make: how to disable fail on warning?

查看:113
本文介绍了海湾合作委员会,使:如何禁用失败警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建gcc以便与AVR微控制器和avr-ada一起使用,并且由于我的常规编译器对AVR所需的版本过于挑剔而导致了一个障碍。我收到以下警告,这反过来导致gcc或make报告错误:

  gcc -c -g -O2 -gnatpg -gnata -nostdinc -I- -I。 -Iada 
-I ../../ gcc / ada ../../gcc/ada/exp_ch5.adb -o ada / exp_ch5.o
exp_ch5.adb:177:16:警告:函数Has_Address_Clause未被引用
make [2]:*** [ada / exp_ch5.o]错误1
make [1]:*** [all-gcc]错误2
make:*** [all]错误2

有没有办法指示gcc或make在这里触发的是-gnatpg(实际上是-gnatg):这是 GNAT实施模式(用于编译GNAT单元)。 -gnatp表示取消所有检查。

我不确定-gnatg的全部效果,但它肯定会将警告视为错误 - 就像 - 错误 - 无论如何建立编译器本身;我想我记得在构建RTS的时候看到了非致命的警告。



一种可能性是只用exp_ch5.adb手工编译而不用-gnatg;你列出的命令是在gcc /发出的,所以

  $ cd gcc 
$ gcc -c -g -O2 -gnatp -gnata -nostdinc -I- -I。 -Iada -I ../../ gcc / ada \
../../gcc/ada/exp_ch5.adb -o ada / exp_ch5.o



然后备份一个级别,然后再次制作。



编译器,所以你不会(我希望!)需要在整个构建的所有三个阶段重复这一点。


I'm trying to build gcc for use with an AVR micro controller and avr-ada, and I've hit a roadblock caused by my regular compiler being too picky about the version I needed for the AVR. I get the following warning, which in turn causes the gcc or make to report an error:

gcc -c -g -O2 -gnatpg -gnata -nostdinc -I- -I. -Iada 
  -I../../gcc/ada ../../gcc/ada/exp_ch5.adb -o ada/exp_ch5.o
exp_ch5.adb:177:16: warning: function "Has_Address_Clause" is not referenced
make[2]: *** [ada/exp_ch5.o] Error 1
make[1]: *** [all-gcc] Error 2
make: *** [all] Error 2

Is there a way to instruct gcc or make to not fail on warnings?

解决方案

The trigger here is the -gnatpg (actually, the -gnatg): this is the "GNAT implementation mode (used for compiling GNAT units)". -gnatp means "suppress all checks".

I'm not sure of the full effect of -gnatg, though it certainly causes warnings to be treated as errors -- like -Werror -- at any rate while building the compiler itself; I think I remember seeing non-fatal warnings while building the RTS.

One possibility would be to compile just exp_ch5.adb by hand without -gnatg; the command you list was issued at gcc/, so

$ cd gcc
$ gcc -c -g -O2 -gnatp -gnata -nostdinc -I- -I. -Iada -I../../gcc/ada \
  ../../gcc/ada/exp_ch5.adb -o ada/exp_ch5.o

Then back up one level, and 'make' again.

This is a cross-compiler, so you won't (I hope!) need to repeat this for all three stages of a full build.

这篇关于海湾合作委员会,使:如何禁用失败警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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