Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@msabwat

Description

@msabwat
  • 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions