hadess / iio-sensor-proxy

IIO accelerometer sensor to input device proxy
196 stars 63 forks source link

make fails with warning as error for unused-result #248

Closed cas-- closed 4 years ago

cas-- commented 5 years ago

gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)

fake-input-accelerometer.c: In function ‘send_uinput_event’:
fake-input-accelerometer.c:90:9: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
  (void) write (data->uinput, &ev, sizeof(ev));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fake-input-accelerometer.c:94:9: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
  (void) write (data->uinput, &ev, sizeof(ev));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fake-input-accelerometer.c:98:9: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
  (void) write (data->uinput, &ev, sizeof(ev));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fake-input-accelerometer.c:104:9: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
  (void) write (data->uinput, &ev, sizeof(ev));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
iio-buffer-utils.c: In function ‘_write_sysfs_int’:
iio-buffer-utils.c:415:3: error: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Werror=unused-result]
   fscanf(sysfsfp, "%d", &test);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
iio-buffer-utils.c: In function ‘_write_sysfs_string’:
iio-buffer-utils.c:463:2: error: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Werror=unused-result]
  fscanf(sysfsfp, "%s", temp);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
iio-buffer-utils.c: In function ‘build_channel_array’:
iio-buffer-utils.c:296:4: error: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Werror=unused-result]
    fscanf (sysfsfp, "%d", &ret);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
iio-buffer-utils.c:320:4: error: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Werror=unused-result]
    fscanf (sysfsfp, "%u", &current->index);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
iio-buffer-utils.c: In function ‘iioutils_get_param_float’:
iio-buffer-utils.c:208:3: error: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Werror=unused-result]
   fscanf (sysfsfp, "%f", output);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
iio-buffer-utils.c:225:3: error: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Werror=unused-result]
   fscanf (sysfsfp, "%f", output);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
hadess commented 4 years ago

Moved to https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/issues/248