New Ghostscript/GhostPDL compiler warnings - 2018-12-07-15:15:14 - abb742af3affbe00da625a1272d682ac5fd4c964

[email protected] Fri, 7 Dec 2018 17:56:51 -0800 (PST)
Newsgroups gmane.comp.printing.ghostscript.regression
Message-ID <20181208015651.372902040766@i7>
Previous Revision: eab61428b3fa1e4078e71febefe406dad499814e
 Current Revision: abb742af3affbe00da625a1272d682ac5fd4c964

commit abb742af3affbe00da625a1272d682ac5fd4c964
Author:     Chris Liddell <[email protected]>
AuthorDate: Fri Nov 17 15:17:03 2017 +0000
CommitDate: Fri Dec 7 14:17:55 2018 -0500

    Commit of gpdl-shared-device branch.
    
    This commit is a squashed version of the gpdl-shared-device
    branch. Essentially this is a first version of the new
    language switching mechanism.
    
    This does not build as part as "all", but rather as "experimental"
    or "gpdl".

Resource/Init/gs_cet.ps
Resource/Init/gs_init.ps
base/gp_mspol.c
base/gs.mak
base/gsalloc.c
base/gsdevice.c
base/gsiodev.c
base/gsiodevs.c
base/gslibctx.c
base/gslibctx.h
base/gsmalloc.c
base/gsmalloc.h
base/gsmchunk.c
base/gsmemory.c
base/gsmemory.h
base/gsmemret.c
base/gsstate.c
base/gsutil.c
base/gxdownscale.c
base/gxdownscale.h
configure.ac
devices/devs.mak
devices/gdevchameleon.c
gpdl/psi/psitop.c
pcl/pcl/pctop.c
pcl/pl/pjparsei.c
pcl/pl/pl.mak
pcl/pl/plapi.c
pcl/pl/plapi.h
pcl/pl/plmain.c
pcl/pl/plmain.h
pcl/pl/pltop.c
pcl/pl/pltop.h
pcl/pl/plwmainc.c
pcl/pl/realmain.c
pcl/pxl/pxtop.c
psi/dwdll.h
psi/dwnodll.c
psi/gsdll2.def
psi/gsdll32.def
psi/gsdll32metro.def
psi/gsdll64.def
psi/gsdll64metro.def
psi/gsdllARM32metro.def
psi/ialloc.c
psi/iapi.c
psi/iapi.h
psi/icstate.h
psi/igc.c
psi/imain.c
psi/imain.h
psi/imainarg.c
psi/imainarg.h
psi/imemory.h
psi/iminst.h
psi/int.mak
psi/interp.c
psi/ireclaim.c
psi/msvc.mak
psi/opextern.h
psi/psapi.c
psi/psapi.h
psi/zdevice.c
psi/zfont.c
psi/ziodevsc.c
windows/ghostscript.vcproj
xps/xpstop.c



Ghostscript:

new gcc warnings (gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609): 

./psi/iapi.c:37:48: warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' [-Wenum-compare]
./psi/iapi.c:38:48: warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' [-Wenum-compare]
./psi/iapi.c:39:48: warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' [-Wenum-compare]
./psi/imain.c:1241:14: warning: variable 'i_ctx_p' set but not used [-Wunused-but-set-variable]

http://miles.ghostscript.com:8080/artifex/abb742af3affbe00da625a1272d682ac5fd4c964/gs-gcc-warnings.txt



new scan-build warnings:

./base/gsalloc.c:2355:14: warning: Dereference of null pointer (loaded from variable 'rpp')
        *rpp = rp;
         ~~~ ^

./psi/iapi.c:37:48: warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' [-Wenum-compare]
 typedef struct { int a[GS_ARG_ENCODING_LOCAL   == PS_ARG_ENCODING_LOCAL   ? 1 : -1]; } compile_time_assert_0;
                                                ^

./psi/iapi.c:38:48: warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' [-Wenum-compare]
 typedef struct { int a[GS_ARG_ENCODING_UTF8    == PS_ARG_ENCODING_UTF8    ? 1 : -1]; } compile_time_assert_1;
                                                ^

./psi/iapi.c:39:48: warning: comparison between 'enum <anonymous>' and 'enum <anonymous>' [-Wenum-compare]
 typedef struct { int a[GS_ARG_ENCODING_UTF16LE == PS_ARG_ENCODING_UTF16LE ? 1 : -1]; } compile_time_assert_2;
                                                ^

./psi/imain.c:1078:13: warning: Access to field 'memory' results in a dereference of a null pointer (loaded from variable 'pdev')
            gs_unregister_root(pdev->memory, dev_root_ptr, "gs_main_finit");
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./psi/imain.c:1241:14: warning: variable 'i_ctx_p' set but not used [-Wunused-but-set-variable]
     i_ctx_t *i_ctx_p;
              ^

./psi/imain.c:1250:5: warning: Value stored to 'i_ctx_p' is never read
    i_ctx_p = minst->i_ctx_p;
    ^         ~~~~~~~~~~~~~~


http://miles.ghostscript.com:8080/artifex/abb742af3affbe00da625a1272d682ac5fd4c964/gs/index.html

http://miles.ghostscript.com:8080/artifex/abb742af3affbe00da625a1272d682ac5fd4c964/gs-scan-build.txt



new cppcheck warnings (Cppcheck 1.72): 

psi/imain.c:1053: error: Memory pointed to by 'tempnames' is freed twice.
psi/interp.c:1232: error: Expression 'iref_temp=(const struct ref_s*)iref_packed,iref_temp' depends on order of evaluation of side effects
psi/interp.c:1442: error: Expression 'iref_temp=(const struct ref_s*)iref_packed,iref_temp' depends on order of evaluation of side effects
psi/imain.c:1035: error: Memory pointed to by 'tempnames' is freed twice.

http://miles.ghostscript.com:8080/artifex/abb742af3affbe00da625a1272d682ac5fd4c964/gs-cppcheck.txt




GhostPCL:

new scan-build warnings:

./base/gsalloc.c:2355:14: warning: Dereference of null pointer (loaded from variable 'rpp')
        *rpp = rp;
         ~~~ ^

./pcl/pl/plmain.c:1030:21: warning: Value stored to 'code' is never read
                    code = 0;
                    ^      ~

./pcl/pl/pltop.c:102:5: warning: Value stored to 'code' is never read
    code = 0;
    ^      ~


http://miles.ghostscript.com:8080/artifex/abb742af3affbe00da625a1272d682ac5fd4c964/pcl/index.html

http://miles.ghostscript.com:8080/artifex/abb742af3affbe00da625a1272d682ac5fd4c964/pcl-scan-build.txt