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

Make error : comparison between signed and unsigned integer expressions in [src/gdbserver/semihosting.c] #732

Closed
1 task done
msabwat opened this issue Aug 1, 2018 · 1 comment · Fixed by #731
Closed
1 task done

Comments

@msabwat
Copy link

msabwat commented Aug 1, 2018

  • I cloned this repository and started installing by running make release
  • Operating system: e.g Linux, Mac OS X, Windows (with specific version)
    Ubuntu 14.04.5 LTS

A as-detailed description possible of the problem with debug output when available.

When I run make, I get the error below :

Output:

/home/mehdi/stlink/src/gdbserver/semihosting.c: In function ‘do_semihosting’:
/home/mehdi/stlink/src/gdbserver/semihosting.c:344:25: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         if (read_result == (uint32_t)-1) {
                         ^
cc1: all warnings being treated as errors
make[3]: *** [src/gdbserver/CMakeFiles/st-util.dir/semihosting.c.o] Error 1
make[2]: *** [src/gdbserver/CMakeFiles/st-util.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [release] Error 2

Expected/description:
`I fixed it by modifying the files source code (which I find really sloppy), by modifying ssize_t by size_t in the read_result declaration in semihosting.c.
Another solution, would be to add the -Wno-sign-compare flag in Cmake, but I don't think it's a solution either.
I wanted to have the feedback of the community.

Thanks & Regards

@slyshykO
Copy link
Collaborator

slyshykO commented Aug 1, 2018

PR #731 will fix this issue.

@msabwat msabwat closed this as completed Aug 1, 2018
@Nightwalker-87 Nightwalker-87 added this to the v1.5.1 milestone Mar 18, 2020
@Nightwalker-87 Nightwalker-87 linked a pull request Mar 18, 2020 that will close this issue
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants