New Ghostscript/GhostPDL compiler warnings - 2018-09-05-19:15:03 - 2b533271d8bd915593a2f8e1a1f446ee940c7d76

[email protected] Wed, 5 Sep 2018 20:31:44 -0700 (PDT)
Newsgroups gmane.comp.printing.ghostscript.regression
Message-ID <20180906033144.22076204328B@i7>
Previous Revision: a8c7899267121cb92503fe0f7e7f6ae433c386b1
 Current Revision: 2b533271d8bd915593a2f8e1a1f446ee940c7d76

commit 2b533271d8bd915593a2f8e1a1f446ee940c7d76
Author:     Robin Watts <[email protected]>
AuthorDate: Wed Sep 5 18:07:40 2018 +0100
CommitDate: Wed Sep 5 19:20:15 2018 +0100

    Fix arg_copy leaks.
    
    When handling -d or -s args, the code currently arg_copies the string
    it gets back, then uses that copied block to make postscript names
    from.
    
    Here we change the code so that postscript names are made in a
    slightly different way, so they copy the string content. This means
    we can free the arg_copied block afterwards, solving the leaks.
    
    While we are here, remove a layer of nasty variable hiding macros
    that do nothing but confuse things.

psi/iddict.h
psi/idict.c
psi/idict.h
psi/iinit.c
psi/imain.c
psi/imainarg.c
psi/interp.h



Ghostscript:

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

./psi/iinit.c:121:1: warning: no previous prototype for 'i_initial_enter_name_copy' [-Wmissing-prototypes]
./psi/imainarg.c:873:17: warning: implicit declaration of function 'i_initial_enter_name_copy' [-Wimplicit-function-declaration]

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



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

./psi/iinit.c:121:1: warning: no previous prototype for function 'i_initial_enter_name_copy' [-Wmissing-prototypes]
i_initial_enter_name_copy(i_ctx_t *i_ctx_p, const char *nstr, const ref * pref)
^

./psi/imainarg.c:873:17: warning: implicit declaration of function 'i_initial_enter_name_copy' is invalid in C99 [-Wimplicit-function-declaration]
                i_initial_enter_name_copy(minst->i_ctx_p, adef, &value);
                ^


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



new scan-build warnings:

./psi/iinit.c:121:1: warning: no previous prototype for 'i_initial_enter_name_copy' [-Wmissing-prototypes]
 i_initial_enter_name_copy(i_ctx_t *i_ctx_p, const char *nstr, const ref * pref)
 ^

./psi/imainarg.c:873:17: warning: implicit declaration of function 'i_initial_enter_name_copy' [-Wimplicit-function-declaration]
                 i_initial_enter_name_copy(minst->i_ctx_p, adef, &value);
                 ^


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

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