New Ghostscript/GhostPDL compiler warnings - 2018-01-11-08:45:15 - eb59c64085552ef0f98c1afdaae3c39ad4e5d421

[email protected] Thu, 11 Jan 2018 10:46:23 -0800 (PST)
Newsgroups gmane.comp.printing.ghostscript.regression
Message-ID <20180111184623.A127D20401E3@i7>
Previous Revision: 9b3b93ca92f8b9370d4cb5a4e6176df1a06afeda
 Current Revision: eb59c64085552ef0f98c1afdaae3c39ad4e5d421

commit eb59c64085552ef0f98c1afdaae3c39ad4e5d421
Author:     Ray Johnston <[email protected]>
AuthorDate: Wed Jan 10 20:52:35 2018 -0800
CommitDate: Thu Jan 11 08:34:31 2018 -0800

    Fix stale pointer de-reference during GC due to restore.
    
    If a CIEBasedDEF or DEFG colorspace was set in a save level, a restore
    would free the Table memory, but the pgs->icc_profile_cache still had
    a (stale) pointer to that area. Fix by copying the Table to memory that
    is not subject to save/restore (stable_memory). Rely on the GC to free
    up the previous table data since we have no idea what allocator was
    used for it (from PostScript it would be local or global VM). Seen with:
    -Z:?@$ -r300 -sDEVICE=psdcmyk -o x.psd tests_private/comparefiles/Bug688308.ps

psi/zcie.c



Ghostscript:

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

./psi/zcie.c:205:74: warning: passing argument 5 of 'cie_3d_table_param' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
./psi/zcie.c:225:78: warning: passing argument 5 of 'cie_3d_table_param' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

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



new clang warnings (clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)): 

./psi/zcie.c:205:74: warning: passing 'const gs_memory_t *' (aka 'const struct gs_memory_s *') to parameter of type 'gs_memory_t *' (aka 'struct gs_memory_s *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        code = cie_3d_table_param(pta + 3, pclt->dims[0], nbytes, table, mem);
                                                                         ^~~
./psi/zcie.c:180:72: note: passing argument to parameter 'mem' here
                               gs_const_string * strings, gs_memory_t *mem);
                                                                       ^

./psi/zcie.c:225:78: warning: passing 'const gs_memory_t *' (aka 'const struct gs_memory_s *') to parameter of type 'gs_memory_t *' (aka 'struct gs_memory_s *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            code = cie_3d_table_param(psuba + i, d1, nbytes, table + d1 * i, mem);
                                                                             ^~~
./psi/zcie.c:180:72: note: passing argument to parameter 'mem' here
                               gs_const_string * strings, gs_memory_t *mem);
                                                                       ^


http://miles.ghostscript.com:8080/artifex/eb59c64085552ef0f98c1afdaae3c39ad4e5d421/gs-clang-warnings.txt



new scan-build warnings:

./psi/zcie.c:205:74: warning: passing argument 5 of 'cie_3d_table_param' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
         code = cie_3d_table_param(pta + 3, pclt->dims[0], nbytes, table, mem);
                                                                          ^

./psi/zcie.c:225:78: warning: passing argument 5 of 'cie_3d_table_param' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
             code = cie_3d_table_param(psuba + i, d1, nbytes, table + d1 * i, mem);
                                                                              ^


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

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