Re: cppcheck on Dillo source
Jorge Arellano Cid <[email protected]>
| Newsgroups | gmane.comp.web.dillo.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, On Sat, Jul 09, 2016 at 03:28:25PM +0100, Nick Warne wrote: > On Sat, 9 Jul 2016 12:35:10 +0100 > Nick Warne <nick-ucsffw2X/[email protected]> wrote: > > > Hi all, > > > > While waiting for the Tour De France to start on TV, I ran cppcheck on > > Dillo source for something to do - a few errors were picked up! > > > > I have compacted the findings (with two comments from me)and attached > > it as a plain text file. > > > > Keep up the great work guys and thanks! > > > > Nick > > OK, updating cppcheck to 1.74, I ran it again. A new error appears, but > I don't know if it is a false positive, as I still don't really > understand C++ (but do get the logic of function calls vs void etc.: > > Checking ../../slackbuilds/dillo/hg/dillo/src/ui.cc... > [../../slackbuilds/dillo/hg/dillo/src/ui.cc:574]: (error) Return value > of allocation function 'make_filemenu_button' is not stored. > [../../slackbuilds/dillo/hg/dillo/src/ui.cc:588]: (error) Return value > of allocation function 'make_filemenu_button' is not stored. > > Now, the call is: > > make_filemenu_button(); > > to: > > Fl_Widget *UI::make_filemenu_button() > > which returns (btn) > > so is that correct? Where does (btn) go in the calling function - or > what does it do? Patch committed. It wasn't necessary anymore. Most probably it remained from a time when it was used. Now they are stored in local variables so it's safe to make the function void. -- Cheers Jorge.-