Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: xentools411 fails build



On Sat, Mar 16, 2019 at 10:18:48AM +0000, Chavdar Ivanov wrote:
> xenpmd.c: In function 'get_next_battery_file':
> xenpmd.c:90:36: error: '%s' directive output may be truncated writing
> up to 511 bytes into a region of size 271 [-Werror=format-truncation=]
>      #define BATTERY_INFO_FILE_PATH "/tmp/battery/%s/info"
>                                     ^
> xenpmd.c:113:52: note: in expansion of macro 'BATTERY_INFO_FILE_PATH'
>              snprintf(file_name, sizeof(file_name), BATTERY_INFO_FILE_PATH,
>                                                     ^~~~~~~~~~~~~~~~~~~~~~
> xenpmd.c:113:13: note: 'snprintf' output between 19 and 530 bytes into
> a destination of size 284
>              snprintf(file_name, sizeof(file_name), BATTERY_INFO_FILE_PATH,
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>                       dir_entries->d_name);
>                       ~~~~~~~~~~~~~~~~~~~~

IMO the most stupid warning ever added to gcc. I would just disable it for
newer gcc.

Martin


Home | Main Index | Thread Index | Old Index