New Ghostscript/GhostPDL compiler warnings - 2019-05-08-18:00:01 - 86a81b823950c712ac03e0139449045a81672d01

[email protected] Wed, 8 May 2019 20:01:37 -0700 (PDT)
Newsgroups gmane.comp.printing.ghostscript.regression
Message-ID <20190509030137.A874D2040527@i7>
Previous Revision: 2019db2e552653bd0c27377d500de1041c9fd0bc
 Current Revision: 86a81b823950c712ac03e0139449045a81672d01

commit 86a81b823950c712ac03e0139449045a81672d01
Author:     Ken Sharp <[email protected]>
AuthorDate: Wed May 8 14:28:41 2019 +0100
CommitDate: Wed May 8 15:27:28 2019 +0100

    pdfwrite - extend DeviceN attributes dictionary generation
    
    Now that we cater for the /Process dictionary in a DeviceN attributes
    dictionary (and the Subtype) we need to emit those from pdfwrite too.

devices/vector/gdevpdfc.c



Ghostscript:

new scan-build warnings:

./devices/vector/gdevpdfc.c:1178:17: warning: Value stored to 'code' is never read
                code = cos_dict_put((cos_dict_t *)pres_attributes->object, (const byte *)"/Subtype", 8, &v_Subtype_name);
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./devices/vector/gdevpdfc.c:1192:51: warning: Access to field 'object' results in a dereference of a null pointer (loaded from variable 'pres_attributes')
                code = cos_dict_put((cos_dict_t *)pres_attributes->object,
                                                  ^~~~~~~~~~~~~~~~~~~~~~~

./devices/vector/gdevpdfc.c:1243:51: warning: Access to field 'object' results in a dereference of a null pointer (loaded from variable 'pres_attributes')
                code = cos_dict_put((cos_dict_t *)pres_attributes->object,
                                                  ^~~~~~~~~~~~~~~~~~~~~~~


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

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




GhostPCL:

new scan-build warnings:

./devices/vector/gdevpdfc.c:1178:17: warning: Value stored to 'code' is never read
                code = cos_dict_put((cos_dict_t *)pres_attributes->object, (const byte *)"/Subtype", 8, &v_Subtype_name);
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

./devices/vector/gdevpdfc.c:1192:51: warning: Access to field 'object' results in a dereference of a null pointer (loaded from variable 'pres_attributes')
                code = cos_dict_put((cos_dict_t *)pres_attributes->object,
                                                  ^~~~~~~~~~~~~~~~~~~~~~~

./devices/vector/gdevpdfc.c:1243:51: warning: Access to field 'object' results in a dereference of a null pointer (loaded from variable 'pres_attributes')
                code = cos_dict_put((cos_dict_t *)pres_attributes->object,
                                                  ^~~~~~~~~~~~~~~~~~~~~~~


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

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