• J
    turbostat: Check return value of fscanf · 74823419
    Josh Triplett 提交于
    Some systems declare fscanf with the warn_unused_result attribute.  On
    such systems, turbostat generates the following warnings:
    
    turbostat.c: In function 'get_core_id':
    turbostat.c:1203:8: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
    turbostat.c: In function 'get_physical_package_id':
    turbostat.c:1186:8: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
    turbostat.c: In function 'cpu_is_first_core_in_package':
    turbostat.c:1169:8: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
    turbostat.c: In function 'cpu_is_first_sibling_in_core':
    turbostat.c:1148:8: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
    
    Fix these by checking the return value of those four calls to fscanf.
    Signed-off-by: NJosh Triplett <josh@joshtriplett.org>
    Signed-off-by: NLen Brown <len.brown@intel.com>
    74823419
turbostat.c 58.9 KB