Bug 691452 - compiler warnngs with intel C.
Summary: compiler warnngs with intel C.
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Font API (show other bugs)
Version: master
Hardware: Other Linux
: P4 normal
Assignee: Robin Watts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-12 07:00 UTC by Hin-Tak Leung
Modified: 2020-07-09 09:22 UTC (History)
3 users (show)

See Also:
Customer:
Word Size: ---


Attachments
build log using the 32-bit version of the intel compiler (213.11 KB, text/plain)
2010-07-12 07:00 UTC, Hin-Tak Leung
Details
build log using the 64-bit version of the intel compiler (217.35 KB, text/plain)
2010-07-12 07:02 UTC, Hin-Tak Leung
Details
Patch to fix remaining important warnings (2.21 KB, patch)
2018-12-28 19:49 UTC, Peter Cherepanov
Details | Diff
Patch (684 bytes, patch)
2020-07-08 04:16 UTC, Peter Cherepanov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hin-Tak Leung 2010-07-12 07:00:10 UTC
Created attachment 6459 [details]
build log using the 32-bit version of the intel compiler

tried compiling with intel C on linux (ln -s base/unixansi.mak Makefile ; make), most of the warnings are with type-casts, but these aren't. The first one looks like a real bug in the font code (last worked on by Igor and Peter) so goes to Chris first, then maybe Robin/Michael/Lars ,as these covers a few areas - font, path, color, libtiff.

./base/gsfcid2.c(282): warning #175: subscript out of range
./base/gxfill.c(304): warning #413: variable "lst" has an uninitialized const field
lcms/src/cmsio1.c(1637): warning #186: pointless comparison of unsigned integer with zero
lcms/src/cmsio1.c(2915): warning #186: pointless comparison of unsigned integer with zero
tiff//libtiff/tif_unix.c(101): warning #810: conversion from "void *" to "int" may lose significant bits
tiff//libtiff/tif_unix.c(58): warning #810: conversion from "void *" to "int" may lose significant bits
tiff//libtiff/tif_unix.c(64): warning #810: conversion from "void *" to "int" may lose significant bits
tiff//libtiff/tif_unix.c(70): warning #810: conversion from "void *" to "int" may lose significant bits
tiff//libtiff/tif_unix.c(76): warning #810: conversion from "void *" to "int" may lose significant bits
tiff//libtiff/tif_unix.c(88): warning #810: conversion from "void *" to "int" may lose significant bits
Comment 1 Hin-Tak Leung 2010-07-12 07:02:09 UTC
Created attachment 6460 [details]
build log using the 64-bit version of the intel compiler

a similar log from using the 64-bit version of the intel compiler
Comment 2 Chris Liddell (chrisl) 2010-07-13 18:31:34 UTC
./base/gsfcid2.c(282): warning #175: subscript out of range

should be resolved with r.11507 (I don't have the Intel compiler to be sure, but the code was clearly wrong!).
Comment 3 Chris Liddell (chrisl) 2010-07-13 18:33:09 UTC
passing this parcel along......
Comment 4 Henry Stiles 2010-07-29 17:04:22 UTC
We agreed to be gcc -Wall compliant only, but if there are really useful warnings here by all means let's fix them.  Degrading readability to fix warnings is not desirable.
Comment 5 Peter Cherepanov 2018-12-28 19:49:35 UTC
Created attachment 16631 [details]
Patch to fix remaining important warnings

Most of the warnings reported in the build logs no longer occur.
When building all the products built by make, a significant fraction of the warnings is from external code such as freetype. None of these warnings are critical.

Of the warnings in Ghostscript code, almost all were of two kinds:
"warning #3179: deprecated conversion of string literal to char*", which is a legal part of the C standard.
"command line warning #10148: option '-Wno-misleading-indentation' not supported", where the configure script detected icc as gcc.
Neither of these is significant. After filtering these out, only 4 warnings remained in the Ghostscript codebase:

./contrib/gdevhl12.c(484): warning #181: argument of type "unsigned long" is incompatible with format "%u", expecting argument of type "unsigned int"
          fprintf(prn_stream, "\033*b%uW", s->out_count * sizeof(u16) + 9);
./contrib/japanese/gdevp201.c(246): warning #181: argument of type "long" is incompatible with format "%04d", expecting argument of type "int"
                          (out_beg - out) / bytes_per_column);
./base/gscspace.c(186): warning #266: function "sfclose" declared implicitly
      code = sfclose(str);
./base/gscspace.c(200): warning #266: function "gsicc_get_icc_buff_hash" declared implicitly
      gsicc_get_icc_buff_hash(profile->buffer, &(profile->hashcode),

This patch fixes all 4 of these.
Comment 6 Peter Cherepanov 2020-07-08 04:16:58 UTC
Created attachment 19425 [details]
Patch

All the warnings are now fixed but makefile still lack the necessary dependencies. This is the last hunk to commit for this bug.
Comment 7 Robin Watts 2020-07-09 09:22:56 UTC
Fixed due to Peter's efforts. Thanks.