loongson-community / binutils-gdb

The binutils and gdb source tree for Loongson
GNU General Public License v2.0
5 stars 2 forks source link

[gas/config/tc-mips.c] Treat warning as error #1

Closed xiangzhai closed 6 years ago

xiangzhai commented 6 years ago

Hi GCC developers,

make[4]: Entering directory '/data/project/xiangzhai/loongson-gnu-toolchain/build/gas'
gcc -DHAVE_CONFIG_H -I. -I../../gas  -I. -I../../gas -I../bfd -I../../gas/config -I../../gas/../include -I../../gas/.. -I../../gas/../bfd -DLOCALEDIR="\"/usr/local/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -Werror -Wwrite-strings  -g -O2 -c -o tc-mips.o `test -f 'config/tc-mips.c' || echo '../../gas/'`config/tc-mips.c
../../gas/config/tc-mips.c: In function ‘md_assemble’:
../../gas/config/tc-mips.c:4175:24: error: passing argument 1 of ‘md_assemble’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
            md_assemble("sync");
                        ^~~~~~
../../gas/config/tc-mips.c:4122:1: note: expected ‘char *’ but argument is of type ‘const char *’
 md_assemble (char *str)
 ^~~~~~~~~~~
../../gas/config/tc-mips.c: In function ‘nops_for_loongson3_loads’:
../../gas/config/tc-mips.c:6716:66: error: unused parameter ‘hist’ [-Werror=unused-parameter]
 nops_for_loongson3_loads (int ignore, const struct mips_cl_insn *hist,
                                                                  ^~~~
cc1: all warnings being treated as errors
Makefile:1445: recipe for target 'tc-mips.o' failed

I have already send code review email to @heiher and Chenghua, please review my patch, thanks a lot!

Regards, Leslie Zhai - a LLVM developer https://reviews.llvm.org/p/xiangzhai/