@@ -510,10 +510,15 @@ static struct hid_device_info *create_device_info_with_usage(IOHIDDeviceRef dev,
510510 if (res == KERN_SUCCESS ) {
511511 /* max value of entry_id(uint64_t) is 18446744073709551615 which is 20 characters long,
512512 so for (max) "path" string 'DevSrvsID:18446744073709551615' we would need
513- 9+1+20+1=31 bytes byffer , but allocate 32 for simple alignment */
513+ 9+1+20+1=31 bytes buffer , but allocate 32 for simple alignment */
514514 cur_dev -> path = calloc (1 , 32 );
515515 if (cur_dev -> path != NULL ) {
516+ /* Yes, compiler, we know that snprintf is preferable,
517+ but we're not ready to abandon older macOS-es/SDKs where it is not yet available */
518+ #pragma GCC diagnostic push
519+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
516520 sprintf (cur_dev -> path , "DevSrvsID:%llu" , entry_id );
521+ #pragma GCC diagnostic pop
517522 }
518523 }
519524
@@ -983,9 +988,16 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path)
983988 dev -> max_input_report_len = (CFIndex ) get_max_report_length (dev -> device_handle );
984989 dev -> input_report_buf = (uint8_t * ) calloc (dev -> max_input_report_len , sizeof (uint8_t ));
985990
991+
992+ /* Yes, compiler, we know that snprintf is preferable,
993+ but we're not ready to abandon older macOS-es/SDKs where it is not yet available */
994+ #pragma GCC diagnostic push
995+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
986996 /* Create the Run Loop Mode for this device.
987997 printing the reference seems to work. */
988998 sprintf (str , "HIDAPI_%p" , (void * ) dev -> device_handle );
999+ #pragma GCC diagnostic pop
1000+
9891001 dev -> run_loop_mode =
9901002 CFStringCreateWithCString (NULL , str , kCFStringEncodingASCII );
9911003
0 commit comments