[x265] Some compiler warnings under Linux

Andrey Semashev andrey.semashev at gmail.com
Sat Jul 13 19:10:28 CEST 2019


Here's a patch I'm using.

On 7/13/19 6:21 PM, Mario Rohkrämer wrote:
> Forgot to mention: This was v3.1.1+1
> 
> 
> Am 13.07.2019, 16:41 Uhr, schrieb Mario *LigH* Rohkrämer <contact at ligh.de>:
> 
>> Ubuntu 18.04 LTS + GCC 9.0
>>
>>
>> /home/ligh/x265/source/encoder/ratecontrol.cpp: In member function 
>> ‘int x265::RateControl::writeRateControlFrameStats(x265::Frame*, 
>> x265::RateControlEntry*)’:
>> /home/ligh/x265/source/encoder/ratecontrol.cpp:2867:21: warning: 
>> passing argument 1 to restrict-qualified parameter aliases with 
>> argument 3 [-Wrestrict]
>>   2867 |             sprintf(deltaPOC, "%s%d~", deltaPOC, 
>> rpsWriter->deltaPOC[i]);
>>        |                     ^~~~~~~~           ~~~~~~~~
>> /home/ligh/x265/source/encoder/ratecontrol.cpp:2868:21: warning: 
>> passing argument 1 to restrict-qualified parameter aliases with 
>> argument 3 [-Wrestrict]
>>   2868 |             sprintf(bUsed, "%s%d~", bUsed, rpsWriter->bUsed[i]);
>>        |                     ^~~~~           ~~~~~
>> /home/ligh/x265/source/encoder/ratecontrol.cpp:2867:36: warning: ‘~’ 
>> directive writing 1 byte into a region of size between 0 and 127 
>> [-Wformat-overflow=]
>>   2867 |             sprintf(deltaPOC, "%s%d~", deltaPOC, 
>> rpsWriter->deltaPOC[i]);
>>        |                                    ^
>> /home/ligh/x265/source/encoder/ratecontrol.cpp:2867:20: note: 
>> ‘sprintf’ output between 3 and 140 bytes into a destination of size 128
>>   2867 |             sprintf(deltaPOC, "%s%d~", deltaPOC, 
>> rpsWriter->deltaPOC[i]);
>>        | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> /home/ligh/x265/source/encoder/ratecontrol.cpp:2868:33: warning: ‘~’ 
>> directive writing 1 byte into a region of size between 0 and 39 
>> [-Wformat-overflow=]
>>   2868 |             sprintf(bUsed, "%s%d~", bUsed, rpsWriter->bUsed[i]);
>>        |                                 ^
>> /home/ligh/x265/source/encoder/ratecontrol.cpp:2868:20: note: 
>> ‘sprintf’ output between 3 and 42 bytes into a destination of size 40
>>   2868 |             sprintf(bUsed, "%s%d~", bUsed, rpsWriter->bUsed[i]);
>>        |             ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_sprintf_warnings.patch
Type: text/x-patch
Size: 1457 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20190713/410adc3f/attachment.bin>


More information about the x265-devel mailing list