New Ghostscript/GhostPDL compiler warnings - 2018-03-12-07:30:14 - c6596a021cbe1cd716eaf50e3dd06de646e05572

[email protected] Mon, 12 Mar 2018 09:35:04 -0700 (PDT)
Newsgroups gmane.comp.printing.ghostscript.regression
Message-ID <20180312163504.E5439204050D@i7>
Previous Revision: 3b3d8f74dc026c4f1af5022a1527d41d21511401
 Current Revision: c6596a021cbe1cd716eaf50e3dd06de646e05572

commit c6596a021cbe1cd716eaf50e3dd06de646e05572
Author:     Ken Sharp <[email protected]>
AuthorDate: Mon Mar 12 14:22:44 2018 +0000
CommitDate: Mon Mar 12 14:22:44 2018 +0000

    pdfwrite - avoid use of /.notdef when converting PCL fonts to type 3
    
    Bug #699102 "using -sDEVICE=pdfwrite option generate an incorrect code 128 barcode"
    
    This is actually an Acrobat bug, every other viewer I've tested works as
    expected, Acrobat does not.
    
    The problem appears to be related to defining a /.notdef glyph and
    encoding it at a position other than 0 in the Encoding. If we do that,
    and use the encoded /.notdef glyph, Acrobat quietly replaces it with the
    glyph encoded at position 0 in the Encoding of the font.
    
    Because of the way that PCL fonts work, when we are converting PCL
    fonts to type 3 PDF fonts, the character (PCL) 0x1D gets assigned the
    glyph name /.notdef. The actual Encoding of the glyph is at position
    0x1D however, which causes Acrobat to substitute the glyph at Encoding
    position 0.
    
    This is obviously wrong. However, since its Acrobat, here we add yet
    another heuristic to avoid defining glyphs with the name /.notdef when
    creating type 3 PDF fonts from PCL fonts.
    
    No differences expected

devices/vector/gdevpdtt.c



Ghostscript:

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

./devices/vector/gdevpdtt.c:2798:75: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness [-Wpointer-sign]
./devices/vector/gdevpdtt.c:2798:75: warning: pointer targets in passing argument 1 of '__builtin_strlen' differ in signedness [-Wpointer-sign]

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



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

./devices/vector/gdevpdtt.c:2798:75: warning: passing 'const byte *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        || (penum->orig_font->FontType > 42 && gnstr->size == 7 && strcmp(gnstr->data, ".notdef")== 0)) {
                                                                          ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string2.h:803:40: note: expanded from macro 'strcmp'
      && (__s1_len = __builtin_strlen (s1), __s2_len = __builtin_strlen (s2), \
                                       ^~

./devices/vector/gdevpdtt.c:2798:75: warning: passing 'const byte *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        || (penum->orig_font->FontType > 42 && gnstr->size == 7 && strcmp(gnstr->data, ".notdef")== 0)) {
                                                                          ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string2.h:806:27: note: expanded from macro 'strcmp'
      ? __builtin_strcmp (s1, s2)                                             \
                          ^~

./devices/vector/gdevpdtt.c:2798:75: warning: passing 'const byte *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        || (penum->orig_font->FontType > 42 && gnstr->size == 7 && strcmp(gnstr->data, ".notdef")== 0)) {
                                                                          ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string2.h:808:36: note: expanded from macro 'strcmp'
         && (__s1_len = __builtin_strlen (s1), __s1_len < 4)                  \
                                          ^~

./devices/vector/gdevpdtt.c:2798:75: warning: passing 'const byte *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        || (penum->orig_font->FontType > 42 && gnstr->size == 7 && strcmp(gnstr->data, ".notdef")== 0)) {
                                                                          ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string2.h:810:26: note: expanded from macro 'strcmp'
            ? __builtin_strcmp (s1, s2)                                       \
                                ^~

./devices/vector/gdevpdtt.c:2798:75: warning: passing 'const byte *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        || (penum->orig_font->FontType > 42 && gnstr->size == 7 && strcmp(gnstr->data, ".notdef")== 0)) {
                                                                          ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string2.h:815:29: note: expanded from macro 'strcmp'
               ? __builtin_strcmp (s1, s2)                                    \
                                   ^~

./devices/vector/gdevpdtt.c:2798:75: warning: passing 'const byte *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        || (penum->orig_font->FontType > 42 && gnstr->size == 7 && strcmp(gnstr->data, ".notdef")== 0)) {
                                                                          ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string2.h:817:26: note: expanded from macro 'strcmp'
            : __builtin_strcmp (s1, s2)))); })
                                ^~


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



new scan-build warnings:

./devices/vector/gdevpdtt.c:2798:75: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness [-Wpointer-sign]
         || (penum->orig_font->FontType > 42 && gnstr->size == 7 && strcmp(gnstr->data, ".notdef")== 0)) {
                                                                           ^

./devices/vector/gdevpdtt.c:2798:75: warning: pointer targets in passing argument 1 of '__builtin_strlen' differ in signedness [-Wpointer-sign]
         || (penum->orig_font->FontType > 42 && gnstr->size == 7 && strcmp(gnstr->data, ".notdef")== 0)) {
                                                                           ^


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

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




GhostPCL:

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

./devices/vector/gdevpdtt.c:2798:75: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness [-Wpointer-sign]
./devices/vector/gdevpdtt.c:2798:75: warning: pointer targets in passing argument 1 of '__builtin_strlen' differ in signedness [-Wpointer-sign]

http://miles.ghostscript.com:8080/artifex/c6596a021cbe1cd716eaf50e3dd06de646e05572/pcl-gcc-warnings.txt



new scan-build warnings:

./devices/vector/gdevpdtt.c:2798:75: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness [-Wpointer-sign]
         || (penum->orig_font->FontType > 42 && gnstr->size == 7 && strcmp(gnstr->data, ".notdef")== 0)) {
                                                                           ^

./devices/vector/gdevpdtt.c:2798:75: warning: pointer targets in passing argument 1 of '__builtin_strlen' differ in signedness [-Wpointer-sign]
         || (penum->orig_font->FontType > 42 && gnstr->size == 7 && strcmp(gnstr->data, ".notdef")== 0)) {
                                                                           ^


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

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