bugThe FreeType Project - Bugs: bug #43497, Static code analysis...

 
 

bug #43497: Static code analysis performance/warning/leak uninitialized

Submitted by:  None
Submitted on:  Wed 29 Oct 2014 03:05:39 PM UTC  
 
Severity: 3 - NormalItem Group: None
Status: InvalidPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 05 Dec 2014 06:34:16 AM UTC, comment #2:

In FreeType, I've just replaced all

#include FOO_H

with

#include foo.h

using a small script, then executing

cd freetype2
cppcheck \
--force \
--enable=all \
-I /usr/local/include/harfbuzz \
-I include \
-I include/config \
-I include/internal \
-DFT2_BUILD_LIBRARY \
. &> cppcheck.log

(using a current git version of `cppcheck') and I got not a single issue except some harmless warnings regarding `FT_UNUSED'.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 29 Oct 2014 05:13:50 PM UTC, comment #1:

Thanks. However, most of the errors cppcheck reports are no errors at all. Reason is the following bug (or rather, missing feature):

http://trac.cppcheck.net/ticket/3654

This tool simply doesn't understand

#include FOO_H

where `FOO_H' is a macro, and support of this feature is essential to analyze FreeType's source code.

In case you are brave, you might help us by running cppcheck on a specially prepared FreeType source code so that cppcheck yields sensible results: Simply replace all

#include FOO_H

lines with the correct

#include <path/to/foo.h>

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 29 Oct 2014 03:05:39 PM UTC, original submission:

commit d8632a842edecf4d59349e727ba2df44a714abc8

$ cppcheck -j4 --enable=warning,performance,portability freetype2.git 2> Bugs_freetype2.txt

[builds/mac/ftmac.c:934]: (error) Uninitialized variable: lwfn_file_name
[builds/mac/ftmac.c:1246]: (error) Uninitialized variable: lwfn_file_name
[src/autofit/afcjk.c:1771] -> [src/autofit/afcjk.c:1748]: (warning) Possible null pointer dereference: blue - otherwise it is redundant to check it against null.
[src/autofit/aflatin.c:2379] -> [src/autofit/aflatin.c:2350]: (warning) Possible null pointer dereference: blue - otherwise it is redundant to check it against null.
[src/autofit/aflatin2.c:1884] -> [src/autofit/aflatin2.c:1868]: (warning) Possible null pointer dereference: blue - otherwise it is redundant to check it against null.
[src/autofit/aflatin2.c:1887] -> [src/autofit/aflatin2.c:1868]: (warning) Possible null pointer dereference: blue - otherwise it is redundant to check it against null.
[src/autofit/afpic.c:121] -> [src/autofit/afpic.c:129]: (performance) Variable 'ss' is reassigned a value before the old one has been used.
[src/autofit/afpic.c:129] -> [src/autofit/afpic.c:137]: (performance) Variable 'ss' is reassigned a value before the old one has been used.
[src/base/ftgloadr.c:82]: (error) Uninitialized variable: error
[src/base/ftgloadr.c:180]: (error) Uninitialized variable: error
[src/base/ftobjs.c:207]: (error) Uninitialized variable: error
[src/base/ftobjs.c:333]: (error) Uninitialized variable: error
[src/base/ftobjs.c:1197]: (error) Uninitialized variable: error
[src/base/ftobjs.c:2452]: (error) Uninitialized variable: error
[src/base/ftobjs.c:4632]: (error) Uninitialized variable: error
[src/base/ftinit.c:171]: (error) Uninitialized variable: error
[src/base/ftinit.c:183]: (error) Uninitialized variable: error
[src/base/ftglyph.c:301]: (error) Uninitialized variable: error
[src/base/ftmac.c:551]: (error) Uninitialized variable: lwfn_file_name
[src/base/ftmac.c:859]: (error) Uninitialized variable: lwfn_file_name
[src/base/ftrfork.c:539]: (error) Uninitialized variable: error
[src/base/ftrfork.c:575]: (error) Uninitialized variable: error
[src/base/ftrfork.c:727]: (error) Uninitialized variable: error
[src/base/ftrfork.c:732]: (error) Uninitialized variable: error
[src/base/ftstroke.c:812]: (error) Uninitialized variable: error
[src/base/ftobjs.c:1363]: (error) Uninitialized variable: error
[src/base/ftobjs.c:1461]: (error) Uninitialized variable: error
[src/base/ftobjs.c:1466]: (error) Uninitialized variable: error
[src/base/ftobjs.c:1468]: (error) Uninitialized variable: error
[src/base/ftobjs.c:1477]: (error) Uninitialized variable: error
[src/bzip2/ftbzip2.c:241]: (error) Uninitialized variable: error
[src/cache/ftcmanag.c:200]: (error) Uninitialized variable: mrunode
[src/cache/ftcmanag.c:328]: (error) Uninitialized variable: mrunode
[src/cache/ftcmanag.c:405]: (error) Uninitialized variable: error
[src/cache/ftccache.c:346]: (error) Uninitialized variable: error
[src/cache/ftccmap.c:136]: (error) Uninitialized variable: error
[src/cache/ftcimage.c:89]: (error) Uninitialized variable: error
[src/cache/ftcsbits.c:60]: (error) Uninitialized variable: error
[src/cache/ftcbasic.c:327]: (error) Uninitialized variable: _mrunode
[src/cache/ftcbasic.c:395]: (error) Uninitialized variable: _mrunode
[src/cache/ftcbasic.c:514]: (error) Uninitialized variable: _mrunode
[src/cache/ftcbasic.c:584]: (error) Uninitialized variable: _mrunode
[src/cff/cffload.c:220]: (error) Uninitialized variable: error
[src/cff/cffload.c:293]: (error) Uninitialized variable: error
[src/cff/cffparse.c:813]: (error) Uninitialized variable: error
[src/cid/cidparse.c:81]: (error) Uninitialized variable: error
[src/gxvalid/gxvcommn.c:795] -> [src/gxvalid/gxvcommn.c:792]: (warning) Possible null pointer dereference: func - otherwise it is redundant to check it against null.
[src/gzip/ftgzip.c:268]: (error) Uninitialized variable: error
[src/gzip/ftgzip.c:364]: (error) Uninitialized variable: error
[src/gzip/inftrees.c:142] -> [src/gzip/inftrees.c:143]: (performance) Variable 'p' is reassigned a value before the old one has been used.
[src/gzip/zutil.c:125]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/gzip/zutil.c:144]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/gzip/zutil.c:150]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/lzw/ftlzw.c:104]: (error) Uninitialized variable: error
[src/lzw/ftlzw.c:166]: (error) Uninitialized variable: error
[src/pfr/pfrload.c:168]: (error) Uninitialized variable: error
[src/pfr/pfrload.c:216]: (error) Uninitialized variable: error
[src/pfr/pfrload.c:328]: (error) Uninitialized variable: error
[src/psaux/afmparse.c:538]: (error) Uninitialized variable: error
[src/psaux/afmparse.c:605]: (error) Uninitialized variable: error
[src/psaux/afmparse.c:703]: (error) Uninitialized variable: error
[src/psaux/psobjs.c:91]: (error) Uninitialized variable: error
[src/psaux/psobjs.c:128]: (error) Uninitialized variable: error
[src/pshinter/pshalgo.c:241]: (error) Uninitialized variable: error
[src/pshinter/pshglob.c:749]: (error) Uninitialized variable: error
[src/raster/ftraster.c:3501]: (error) Uninitialized variable: error
[src/psnames/psmodule.c:372]: (error) Uninitialized variable: error
[src/psnames/psmodule.c:393]: (error) Uninitialized variable: error
[src/raster/ftraster.c:2264]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:2520]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:2521]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:2522]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:2533]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:2534]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:2694]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:3424]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:3445]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:3462]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:3564]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/raster/ftraster.c:3566]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/sfnt/ttload.c:148]: (error) Uninitialized variable: error
[src/sfnt/ttload.c:509]: (error) Uninitialized variable: error
[src/sfnt/sfobjs.c:756]: (error) Uninitialized variable: error
[src/sfnt/sfobjs.c:763]: (error) Uninitialized variable: error
[src/sfnt/ttcmap.c:3432]: (error) Uninitialized variable: error
[src/smooth/ftgrays.c:2075]: (error) Uninitialized variable: error
[src/smooth/ftgrays.c:174]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/smooth/ftgrays.c:2041]: (warning) Assignment of function parameter has no effect outside the function. Did you forget dereferencing it?
[src/truetype/ttgload.c:146]: (error) Uninitialized variable: error
[src/truetype/ttgload.c:295]: (error) Uninitialized variable: error
[src/truetype/ttobjs.c:141]: (error) Uninitialized variable: error
[src/truetype/ttinterp.c:535]: (error) Uninitialized variable: error
[src/type1/t1load.c:1204]: (error) Uninitialized variable: error
[src/truetype/ttinterp.c:1964]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:1981]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2003]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2014]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2048]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2089]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2131]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2173]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2215]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2257]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2570]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2597]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:2741]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:4435]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:4538]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:4877]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:5763]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:5972]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:6873]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:7069]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:7388]: (error) Uninitialized variable: __dummy
[src/truetype/ttinterp.c:7891]: (error) Uninitialized variable: __dummy
[src/type1/t1parse.c:93]: (error) Uninitialized variable: error
[src/type42/t42parse.c:359]: (error) Uninitialized variable: error

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #32339:  Bugs_freetype2.txt added by None (10KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 05 Dec 2014 06:34:16 AM UTCwlStatusNeed Info=>Invalid
      Open/ClosedOpen=>Closed
    Wed 29 Oct 2014 05:13:50 PM UTCwlStatusNone=>Need Info
      Assigned toNone=>wl
    Wed 29 Oct 2014 03:05:39 PM UTCNoneAttached File-=>Added Bugs_freetype2.txt, #32339

    Back to the top


    Powered by Savane 3.1-cleanup1