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

Build failure: Comparison of char index with -1 in main.cpp:upgrade_loader() #6

Open
afaerber opened this issue Apr 30, 2017 · 3 comments

Comments

@afaerber
Copy link
Contributor

On several non-x86 architectures (ARM, PowerPC, S/390) I am getting build failures with GCC 6.3.1:

[   31s] main.cpp: In function 'bool upgrade_loader(STRUCT_RKDEVICE_DESC&, char*)':
[   31s] main.cpp:1550:13: error: comparison is always false due to limited range of data type [-Werror=type-limits]
[   31s]    if (index == -1) {
[   31s]        ~~~~~~^~~~~
[   31s] main.cpp:1574:13: error: comparison is always false due to limited range of data type [-Werror=type-limits]
[   31s]    if (index == -1) {
[   31s]        ~~~~~~^~~~~
[   33s] cc1plus: all warnings being treated as errors
[   33s] make[1]: *** [Makefile:454: main.o] Error 1
[   33s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/rkdeveloptool-0~git.20170425.e5ee8cc'
[   33s] make: *** [Makefile:470: all-recursive] Error 1

That suggests the type of index, char, is unsigned on those platforms, and that the variable type of index should be changed - either to signed char or maybe to int.

@tstellanova
Copy link

Seeing the same problem. Unable to build natively on Rock64

@Nelson-numerical-software

workaround remove: -Wextra and -Wno-type-limits in makefile.am

@gounthar
Copy link

gounthar commented Apr 5, 2019

Will try that, thanks.

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

4 participants