Shop OBEX P1 Docs P2 Docs Learn Events
spin2cpp warnings — Parallax Forums

spin2cpp warnings

I decided to update my spin2cpp clone to move to the latest code and I got the following warnings while compiling. Probably not a problem but I think Eric likes things to compile without warnings so I thought I'd post them.

Here is the compiler version info:

Davids-MBP:spin2cpp dbetz$ cc --version
Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: x86_64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

backends/asm/outasm.c:2062:18: warning: absolute value function 'abs' given an argument of type 'intptr_t' (aka 'long') but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
int aval = abs(rhs->val);
^
backends/asm/outasm.c:2062:18: note: use function 'labs' instead
int aval = abs(rhs->val);
^~~
labs
backends/asm/outasm.c:2121:50: warning: absolute value function 'abs' given an argument of type 'intptr_t' (aka 'long') but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
Operand *rhs2 = NewOperand(IMM_INT,rhs->name,abs(rhs->val));
^
backends/asm/outasm.c:2121:50: note: use function 'labs' instead
Operand *rhs2 = NewOperand(IMM_INT,rhs->name,abs(rhs->val));
^~~
labs
backends/asm/outasm.c:2136:50: warning: absolute value function 'abs' given an argument of type 'intptr_t' (aka 'long') but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
Operand *lhs2 = NewOperand(IMM_INT,lhs->name,abs(lhs->val));
^
backends/asm/outasm.c:2136:50: note: use function 'labs' instead
Operand *lhs2 = NewOperand(IMM_INT,lhs->name,abs(lhs->val));
^~~
labs
3 warnings generated.
gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/assemble_ir.o -c backends/asm/assemble_ir.c
gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/optimize_ir.o -c backends/asm/optimize_ir.c
gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/inlineasm.o -c backends/asm/inlineasm.c
gcc -MMD -MP -g -Og -Wall -fwrapv -I. -I./backends -I./frontends -I./build -DFLEXSPIN_BUILD -o build/compress_ir.o -c backends/asm/compress_ir.c
backends/asm/compress_ir.c:153:9: warning: variable 'counted' set but not used [-Wunused-but-set-variable]
int counted;
^
backends/asm/compress_ir.c:156:9: warning: variable 'running' set but not used [-Wunused-but-set-variable]
int running;
^
2 warnings generated.

flexcc.c:420:13: warning: variable 'loc' set but not used [-Wunused-but-set-variable]
int loc = 0;
^
1 warning generated.

Comments

  • cgraceycgracey Posts: 14,208

    David! Good to see you.

  • Thanks, Chip! I've actually been watching the forums pretty consistently but haven't had much time to actually participate. It sounds like the P2 is doing pretty well. I hope lots of people build it into successful products and that Parallax makes tons of money!

Sign In or Register to comment.