Re: [PATCH] tools/csr_usb: Fix compilation failure

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

 



Hi Bastien,

>> GCC's "format-nonliteral" security check is enabled as an error in
>> recent versions of Fedora. Given the reduced scope of use, mark the
>> error as ignorable through pragma.
>> 
>> tools/csr_usb.c: In function 'read_value':
>> tools/csr_usb.c:82:2: error: format not a string literal, argument
>> types not checked [-Werror=format-nonliteral]
>>  n = fscanf(file, format, &value);
>>  ^
> 
> I also ran into this, which looks suspicious:
> obexd/plugins/bluetooth.c: In function 'register_profile':
> obexd/plugins/bluetooth.c:310:7: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
>       profile->driver->port);
>       ^~~~~~~
> obexd/plugins/bluetooth.c:314:7: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
>       profile->driver->name);
>       ^~~~~~~

we would have to change the code on how to build the XML record information. However here it is the same issue with the compiler not getting that the actual value used is const. So it seems this warning has no logic on traversing any levels down.

I mean for example HFP_HF_RECORD is a static const string. It just gets handed through an interim const char * pointer variable before used as format descriptor. Frankly gcc is stupid here.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux