karalabe / hid

Gopher Interface Devices (USB HID)
Other
266 stars 132 forks source link

Doesn't seem to compile on Windows 10, mingw64 #23

Open samwho opened 5 years ago

samwho commented 5 years ago
$ go get github.com/dh1tw/streamdeck
# github.com/karalabe/hid
In file included from ..\..\karalabe\hid\hid_enabled.go:40:
..\..\karalabe\hid/hidapi/windows/hid.c: In function 'hid_enumerate':
..\..\karalabe\hid/hidapi/windows/hid.c:431:5: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
     strncpy(cur_dev->path, str, len+1);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
..\..\karalabe\hid/hidapi/windows/hid.c:429:11: note: length computed here
     len = strlen(str);
           ^~~~~~~~~~~

Mingw64 version:

$ choco info mingw
Chocolatey v0.10.8
mingw 8.1.0 [Approved] Downloads cached for licensed users
 Title: MinGW-w64 | Published: 30/10/2018
 Package approved by gep13 on Jun 30 2019 14:22:35.
 Package testing status: Passing on Oct 30 2018 18:40:10.
 Number of Downloads: 154896 | Downloads for this version: 24259
 Package url
 Chocolatey Package Source: n/a
 Package Checksum: 'ObzK15CYC2pW0gGFTFYMQWPSEYV8ono//ozdORZ23GBNY6XHUBFB5EN6gJl3gABZqD8ltzG8zdlGiEvaJ7zjLQ==' (SHA512)
 Tags: compiler gcc mingw mingw-w64
 Software Site: https://mingw-w64.org/
 Software License: n/a
 Summary: GCC for Windows 64 & 32 bits.
 Description: Mingw-w64 is an advancement of the original mingw.org project, created to support the GCC compiler on Windows systems. It has forked it in 2007 in order
to provide support for 64 bits and new APIs. It has since then gained widespread use and distribution.
dh1tw commented 5 years ago

I think this is just a warning. Here it compiles fine (with the same messages) on Windows 10.

gliptak commented 4 years ago

https://github.com/c-ares/c-ares/pull/201