c4ev3 / ev3duder

The LEGO® EV3 Downloader/UploaDER.
http://c4ev3.github.io/ev3duder/doc/html/globals_func.html
GNU General Public License v3.0
32 stars 12 forks source link

debug make target compiles `hid.c` without debug flags #43

Open goretkin opened 2 years ago

goretkin commented 2 years ago

https://github.com/c4ev3/ev3duder/blob/5ceca3/Makefile#L107-L109

passing CLFAGS works, but produces several warnings, such as

hidapi/mac/hid.c:48:90: warning: unused parameter 'attr' [-Wunused-parameter]
static int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count)
                                                                                         ^
hidapi/mac/hid.c:255:20: warning: comparison of integers of different signs: 'CFIndex' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare]
                if (chars_copied == len)
                    ~~~~~~~~~~~~ ^  ~~~
hidapi/mac/hid.c:295:20: warning: comparison of integers of different signs: 'CFIndex' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare]
                if (used_buf_len == len)
                    ~~~~~~~~~~~~ ^  ~~~
hidapi/mac/hid.c:551:65: warning: unused parameter 'result' [-Wunused-parameter]
static void hid_device_removal_callback(void *context, IOReturn result,
a3f commented 2 years ago

I think I vendored HIDAPI to make Windows builds easier, but I don't think it's a good idea anymore. We could fix the warning, but I think the best thing to do here is to use pkg-config to see if there's a host HIDAPI and use that instead.