Bug 690765 - Make Ghostscript compile as C++ program.
Summary: Make Ghostscript compile as C++ program.
Status: RESOLVED WONTFIX
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: master
Hardware: All All
: P4 normal
Assignee: wendyst2
URL:
Keywords: bountiable
Depends on:
Blocks:
 
Reported: 2009-09-14 09:37 UTC by Alex Cherepanov
Modified: 2010-08-10 04:47 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
Partial patch for C++ compatibility (651.75 KB, patch)
2009-11-29 19:29 UTC, wendyst2
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Cherepanov 2009-09-14 09:37:23 UTC
Current Ghostscript code doesn't compile as C++ .
Ghostscript code uses "template" and "this" as variable names.
C++ also has stricter rules about type conversion.

Replacement of typedef'd types with classes helps to trace the access
to the type during development.

Since C++ needs stricter type handling, the Ghostscript code will be
cleaner.
Comment 1 Ralph Giles 2009-09-24 10:16:03 UTC
Just a note to track shared knowledge: Henry mentioned we sometimes treat 'bool'
as 'int'. I think if we're going to have a bool type, it should be treated
consistently, so it works just as well with the native C++ type. Failing that,
we might as well simplify things by removing it entirely and fall back to
standard C practice of actually using an int for true/false states.
Comment 2 wendyst2 2009-11-29 19:29:28 UTC
Created attachment 5725 [details]
Partial patch for C++ compatibility

The changes turned out to be quite extensive. Plus some 3rd party libraries
need to be modified as well, which I am not sure is proper to do. 

Attached is the patch of the fixes so far. It covers the gs native source codes
(in /psi and /base folders), plus the 3rd party libraries except for zlib.

Please review and let me know whether it is worth finishing the changes (in my
opinion it is not, because it touches too many places).
Comment 3 Alex Cherepanov 2010-08-10 04:47:33 UTC
- The patch cannot be applied to the current HEAD revision.
- Applying many hunks manually, reviewing the rest, and fixing new code
  to match the changed code is a significant effort.
- Even the most trivial change in the code can have unexpected results and
  this number of changes guarantees new bugs without fixing any old ones.
- With the changes in every subsystem, the patch need extensive review
  but it didn't get any review in almost a year.

Therefore the bug report is resolved as "won't fix".