Hello,<div><br></div><div>This is patch for libhid so gcc doesn't stop on error if Werror is used: </div><div><br></div><div>Problem:</div><div>======</div><div><div>gcc -DHAVE_CONFIG_H -I. -I..   -DNDEBUG -I../include -I../hidparser -O2 -Wall -W -Werror -MT lshid.o -MD -MP -MF .deps/lshid.Tpo -c -o lshid.o lshid.c</div>
<div>lshid.c: In function <E2><80><98>device_iterator<E2><80><99>:</div><div>lshid.c:32:87: error: parameter <E2><80><98>len<E2><80><99> set but not used [-Werror=unused-but-set-parameter]</div>
<div>cc1: all warnings being treated as errors</div><div><br></div><div>Patch:</div><div>=====</div><div><div>--- lshid.c<span class="Apple-tab-span" style="white-space:pre">      </span>2012-08-26 10:54:29.671277650 +0200</div>
<div>+++ lshid.c.mod<span class="Apple-tab-span" style="white-space:pre">       </span>2012-08-26 10:54:18.007988938 +0200</div><div>@@ -29,6 +29,9 @@</div><div> </div><div> struct usb_dev_handle;</div><div> </div><div>+/* unused parameter - don't give error on that warning */</div>
<div>+#pragma GCC diagnostic push </div><div>+#pragma GCC diagnostic ignored "-Wunused-parameter"</div><div> bool device_iterator (struct usb_dev_handle const* usbdev, void* custom, unsigned int len)</div><div> {</div>
<div>   bool ret = false;</div><div>@@ -36,10 +39,6 @@</div><div>   char current_dev_path[10];</div><div>   const struct usb_device *device = usb_device((struct usb_dev_handle *)usbdev);</div><div>   </div><div>-  /* only here to prevent the unused warning */</div>
<div>-  /* TODO remove */</div><div>-  len = *((unsigned long*)custom);</div><div>- </div><div>   /* Obtain the device's full path */</div><div>   //sprintf(current_dev_path, "%s/%s", usbdev->bus->dirname, usbdev->device->filename);</div>
<div>   sprintf(current_dev_path, "%s/%s", device->bus->dirname, device->filename);</div><div>@@ -72,6 +71,7 @@</div><div>   </div><div>   return ret;</div><div> }</div><div>+#pragma GCC diagnostic pop</div>
<div> </div><div> int main(void)</div><div> {</div></div><div><br></div><div>Hope it helps,</div>-- <br>Vlatko Kosturjak, Kost               <br>
</div>