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

usbip_device_driver.c:108:2: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation] #7

Open
pagkly opened this issue Apr 17, 2020 · 2 comments

Comments

@pagkly
Copy link

pagkly commented Apr 17, 2020

how to solve this error 1 when make install the usbip tools?

user@DESKTOP-KDJ7PIR:/usr/src/4.19.84-microsoft-standard/tools/usb/usbip$ sudo make install -j 12
Making install in libsrc
make[1]: Entering directory '/usr/src/4.19.84-microsoft-standard/tools/usb/usbip/libsrc'
  CC       libusbip_la-usbip_device_driver.lo
  CC       libusbip_la-usbip_common.lo
usbip_device_driver.c: In function ‘read_usb_vudc_device’:
usbip_device_driver.c:108:2: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-tr
uncation]
  108 |  strncpy(dev->path, path, SYSFS_PATH_MAX);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
usbip_device_driver.c:127:2: error: ‘strncpy’ specified bound 32 equals destination size [-Werror=stringop-tru
ncation]
  127 |  strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:472: libusbip_la-usbip_device_driver.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
usbip_common.c: In function ‘read_usb_device’:
usbip_common.c:229:2: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncatio
n]
  229 |  strncpy(udev->path,  path,  SYSFS_PATH_MAX);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
usbip_common.c:230:2: error: ‘strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncatio
]
  230 |  strncpy(udev->busid, name, SYSFS_BUS_ID_SIZE);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:479: libusbip_la-usbip_common.lo] Error 1
make[1]: Leaving directory '/usr/src/4.19.84-microsoft-standard/tools/usb/usbip/libsrc'
make: *** [Makefile:498: install-recursive] Error 1

thank you

@n3rd4i
Copy link

n3rd4i commented May 1, 2020

I've removed the -Werror before running the actual make in files:

  • src/Makefile +2
  • libsrc/Makefile +2
  • Makefile +1

@dkozel
Copy link

dkozel commented Jun 19, 2020

Fixed by the patches in #15

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

3 participants