Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with the waspmote-pro board #80

Open
jdavid opened this issue Aug 10, 2022 · 1 comment
Open

Error with the waspmote-pro board #80

jdavid opened this issue Aug 10, 2022 · 1 comment

Comments

@jdavid
Copy link

jdavid commented Aug 10, 2022

When using NanoCBOR with the waspmote-pro board (in RIOT), I get the following error:

$ BOARD=waspmote-pro make -C tests/pkg_nanocbor
make: Entering directory '/home/jdavid/sandboxes/UiO/RIOT/tests/pkg_nanocbor'
Building application "tests_pkg_nanocbor" for "waspmote-pro" with MCU "atmega1281".

"make" -C /home/jdavid/sandboxes/UiO/RIOT/pkg/nanocbor/ 
"make" -C /home/jdavid/sandboxes/UiO/RIOT/build/pkg/nanocbor/src -f /home/jdavid/sandboxes/UiO/RIOT/Makefile.base MODULE=nanocbor
/home/jdavid/sandboxes/UiO/RIOT/build/pkg/nanocbor/src/encoder.c: In function ‘nanocbor_fmt_double’:
/home/jdavid/sandboxes/UiO/RIOT/build/pkg/nanocbor/src/encoder.c:324:21: error: array subscript ‘uint64_t {aka long long unsigned int}[0]’ is partly outside array bounds of ‘double[1]’ [-Werror=array-bounds]
  324 |     uint16_t exp = (*unum >> DOUBLE_EXP_POS) & DOUBLE_EXP_MASK;
      |                     ^~~~~
/home/jdavid/sandboxes/UiO/RIOT/build/pkg/nanocbor/src/encoder.c:321:57: note: while referencing ‘num’
  321 | int nanocbor_fmt_double(nanocbor_encoder_t *enc, double num)
      |                                                  ~~~~~~~^~~
cc1: all warnings being treated as errors
make[2]: *** [/home/jdavid/sandboxes/UiO/RIOT/Makefile.base:146: /home/jdavid/sandboxes/UiO/RIOT/tests/pkg_nanocbor/bin/waspmote-pro/nanocbor/encoder.o] Error 1
make[1]: *** [Makefile:9: all] Error 2
make: *** [/home/jdavid/sandboxes/UiO/RIOT/tests/pkg_nanocbor/../../Makefile.include:802: pkg-build] Error 2
make: Leaving directory '/home/jdavid/sandboxes/UiO/RIOT/tests/pkg_nanocbor'

This may be related to issue #18

@bergzand
Copy link
Owner

Thanks for the bug report. That indeed looks like an issue related to the word size of the atmega. I'll look into it later this week and see if I can come up with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants