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

GetXLR8Version example fails to compile (Linux) #2

Open
LRitzdorf opened this issue Jan 28, 2022 · 2 comments · May be fixed by #3
Open

GetXLR8Version example fails to compile (Linux) #2

LRitzdorf opened this issue Jan 28, 2022 · 2 comments · May be fixed by #3

Comments

@LRitzdorf
Copy link

LRitzdorf commented Jan 28, 2022

The GetXLR8Version example program fails to compile on my Arch Linux system. I'm using Arduino IDE version 1.8.19, installed from the official Arch repo (the community/arduino package, specifically), and I've followed the quickstart guide (installing board support and the XLR8Info library). Upon compiling, I get a stream of errors in the output log, ending with the usual Error compiling for board XLR8.

Specifically, there are lots of narrowing conversion errors (from ints or unsigned ints to chars), all stemming from the const static char cidTable[] PROGMEM definition on lines 152-160 of src/XLR8Info.cpp. Finally, there's a warning about the left shift operation on line 163 as well, because the compiler thinks the char data type isn't big enough for a 16-bit shift.

I do have some experience with C/C++, and I have to say, these warnings make sense. The typical one-byte char is not large enough to store the values listed in that array. Then again, I would think an issue this obvious would have been caught before deployment, so I feel like I probably have something configured incorrectly. I'm happy to provide further information and test things out for troubleshooting!

@LRitzdorf
Copy link
Author

LRitzdorf commented Jan 28, 2022

As I expected, I've been able to fix the initial stream of narrowing conversion errors by manually modifying XLR8Info.cpp to use an array of unsigned ints instead of chars, though this leaves the bit-shift warning. Of course, changing this to an even larger data type (unsigned long) takes care of that warning as well.

@jpecor
Copy link

jpecor commented Jan 28, 2022

Thanks for letting us know. We'll take a look at it.

@LRitzdorf LRitzdorf linked a pull request Oct 9, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants