[gdal-dev] PVS-Studio "missing move constructor" warnings ?

Andrew C Aitchison andrew at aitchison.me.uk
Sun Oct 16 11:28:23 PDT 2022


On Sun, 16 Oct 2022, Even Rouault wrote:

> Andrew,
>
> remedied with https://github.com/OSGeo/gdal/pull/6534

Thanks. My PVS-Studio is happy now.

I guess I will have to get my head around the differences between
move/assignment/copy operators and constructors :-(


> Le 16/10/2022 à 10:26, Andrew C Aitchison a écrit :
>> 
>> When I run the PVS-Studio static analyzer https://pvs-studio.com/
>> on my driver plugin I get two warnings on cpl code:
>> 
>> PVS-Studio Analysis Results
>> 
>>    Date: Sun Oct 16 09:12:51 2022
>>    PVS-Studio Version: 7.21.64848.262
>>    Command Line: plog-converter -a GA\:1,2 -t fullhtml -o pvs.dir 
>> qctdataset.pvs.log
>>    qctvector.pvs.log qct.pvs.log qed.pvs.log
>>    Total Warnings (GA): 2
>> 
>>    Group Location Level Code Message
>>    General Analysis cpl_string.h:429 Medium V690 The 'CPLStringList' class
>>    implements the move assignment operator, but lacks a move constructor.
>>    It is dangerous to use such a class.
>> 
>>    General Analysis cpl_json.h:53 Medium V690 The 'CPLJSONObject' class
>>    implements the move assignment operator, but lacks a move constructor.
>>    It is dangerous to use such a class.
>> 
>> Any idea whether there is a missing move constructor
>> and whether this is a problem ?
>> 
>> Thanks,

-- 
Andrew C. Aitchison                      Kendal, UK
                    andrew at aitchison.me.uk


More information about the gdal-dev mailing list