octave-maintainers
[Top][All Lists]
Advanced

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

Re: V668 lint errors


From: Rik
Subject: Re: V668 lint errors
Date: Tue, 1 Jan 2019 19:27:06 -0800

On 01/01/2019 06:15 PM, address@hidden wrote:
Subject:
Re: Lint checking Octave
From:
Andreas Weber <address@hidden>
Date:
01/01/2019 10:10 AM
To:
address@hidden
List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
quoted-printable
Precedence:
list
MIME-Version:
1.0
References:
<address@hidden>
In-Reply-To:
<address@hidden>
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=utf-8; format=flowed
Message:
3

Am 31.12.18 um 21:10 schrieb Rik:
dismissed.  I have created a page to track the status of this at
https://wiki.octave.org/PVS_static_analyzer_-_5.0_Release.  The original
bug report is at https://savannah.gnu.org/bugs/?55347.


There are many of V668 "There is no sense in testing the pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error."

Should we remove all of them (with one commit)?

-- Andy

Here is an example of code which triggers the V668 message from display.cc.

--- Code Start ---
        instance = new display_info (query);

        if (instance)
          singleton_cleanup_list::add (cleanup_instance);
--- Code End ---

In this case, it seems pretty clear that we could eliminate the test on "instance".

For the general case, I'm not so sure.

@jwe: Are there any cases you can think of where we might disable exceptions or do something odd where it would not be okay to remove a check for a nullptr?

--Rik

reply via email to

[Prev in Thread] Current Thread [Next in Thread]