boricj / numworks-rpn

RPN calculator for NumWorks
Other
36 stars 11 forks source link

Update for epsilon master (1.8.0_beta) #6

Closed qguv closed 5 years ago

qguv commented 5 years ago

More progress on bringing rpn up-to-date with upstream epsilon. My master branch compiles with the latest epsilon and runs without issue when targeting the simulator.

Unfortunately, I'm having build trouble when targeting real hardware:

pps/rpn/rpn_stack.cpp: In constructor 'Rpn::RpnStack::RpnStack()':
apps/rpn/rpn_stack.cpp:10:5: error: 'strcpy' was not declared in this scope
     strcpy(m_expressions[i], "0");
     ^~~~~~
apps/rpn/rpn_stack.cpp:10:5: note: 'strcpy' is defined in header '<cstring>'; did you forget to '#include <cstring>'?
apps/rpn/rpn_stack.cpp:3:1:
+#include <cstring>
 #include "ion/charset.h"
apps/rpn/rpn_stack.cpp:10:5:
     strcpy(m_expressions[i], "0");
     ^~~~~~
make: *** [Makefile:67: apps/rpn/rpn_stack.o] Error 1

If I use <cstring> and std::strcpy, instead of <string.h> and strcpy, I get a different error:

apps/rpn/rpn_stack.cpp:4:10: fatal error: cstring: No such file or directory
 #include <cstring>
          ^~~~~~~~~
compilation terminated.
make: *** [Makefile:67: apps/rpn/rpn_stack.o] Error 1

Perhaps I'm just missing the embedded stdlib? Could you try to get this code compiled on your machine?

boricj commented 5 years ago

Epsilon doesn't have strcpy() in its standalone C library, swap these calls to strlcpy() instead.

qguv commented 5 years ago

That did it! It's now working on hardware. I believe we're now ready for 1.8.0.

boricj commented 5 years ago

There's a couple of minor issues with the latest epsilon master, but I'll take care of these. Thanks!