Porting binutils to the new P2
David Betz
Posts: 14,516
in Propeller 2
I'm starting to look at porting PropGCC to P2. I mean, to generate P2 code not to actually *run* on P2. In any case, I'm running into my usual problem that Xcode on the Macintosh is overly picky about C code and GCC's build system compiles with -Werror. This means that any warning is treated as an error. My current problem has to do with arguments to printf. I get the following error when trying to build binutils:
Usually, I fix this sort of problem by adding a compiler option to ignore the warning. However, that didn't work in this case. You can see that the options -Wno-format and -Wno-format-signedness are specified on the gcc command line but I still get these warnings. Does anyone know a way around this?
gcc -Wno-string-plus-int -Wno-deprecated-declarations -Wno-empty-body -Wno-self-assign -Wno-sometimes-uninitialized -Wno-uninitialized -Wno-unknown-warning-option -Wno-unused-function -Wno-format -Wno-format-signedness -I. -I../../binutils-propeller/gdb -I../../binutils-propeller/gdb/common -I../../binutils-propeller/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../binutils-propeller/gdb/../include/opcode -I../../binutils-propeller/gdb/../opcodes/.. -I../../binutils-propeller/gdb/../readline/.. -I../../binutils-propeller/gdb/../zlib -I../bfd -I../../binutils-propeller/gdb/../bfd -I../../binutils-propeller/gdb/../include -I../libdecnumber -I../../binutils-propeller/gdb/../libdecnumber -I./../intl -I../../binutils-propeller/gdb/gnulib/import -Ibuild-gnulib/import -DTUI=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wpointer-sign -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral -Werror -c -o darwin-nat.o -MT darwin-nat.o -MMD -MP -MF .deps/darwin-nat.Tpo ../../binutils-propeller/gdb/darwin-nat.c ../../binutils-propeller/gdb/darwin-nat.c:258:30: error: format specifies type 'unsigned int' but the argument has type 'caddr_t' (aka 'char *') [-Werror,-Wformat] name, pid, arg3, arg4, ret, ^~~~
Usually, I fix this sort of problem by adding a compiler option to ignore the warning. However, that didn't work in this case. You can see that the options -Wno-format and -Wno-format-signedness are specified on the gcc command line but I still get these warnings. Does anyone know a way around this?
Comments
It's always better to fix warnings in code instead of just shoving them under the mat...
===Jac