Bug 691129

Summary: Avoid using -Wno-strict-aliasing on old versions of gcc
Product: GhostPCL Reporter: William Bader <williambader>
Component: PCL interpreterAssignee: Henry Stiles <henry.stiles>
Status: RESOLVED FIXED    
Severity: normal CC: williambader
Priority: P4    
Version: 8.70   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---
Attachments: pdlstrict.pat

Description William Bader 2010-02-22 08:10:47 UTC
gcc-2.96 on RedHat Linux 7.3 does not support -Wno-strict-aliasing.
The attached patches allow you to suppress the option by adding
HAVE_NO_STRICT_ALIASING_WARNING= to the "make" command line.
Comment 1 William Bader 2010-02-22 08:12:26 UTC
Created attachment 5977 [details]
pdlstrict.pat

Patches to suppress -Wno-strict-aliasing by using
HAVE_NO_STRICT_ALIASING_WARNING= on the make command line.
Comment 2 Hin-Tak Leung 2010-02-22 08:29:03 UTC
gcc 2.96 is really old and so is redhat 7.3 (about a decade?). gcc 3.x and 4.x
both supports -Wno-strict-aliasing, I say, and it is a good thing for
development and warn against writing bad code. If you really want to skip the
option, you probably want to modify base/configure.ac to test for supported
compiler flags or compiler version, around line 102:

if test $ac_cv_prog_gcc = yes; then
...
Comment 3 Hin-Tak Leung 2010-02-22 08:31:07 UTC
oh sorry, the previous comment was for gs (there is no autoconf for ghostpdl) -
but -Wno-strict-aliasing is a good switch to keep, against writing bad code.
Comment 4 William Bader 2010-02-22 08:48:11 UTC
I realize that -Wno-strict-aliasing is a good switch.  My patches leave it
enabled by default.  The patches only provide a cleaner way to remove it when
necessary.  With the patches, you can remove it through the "make" command line.
 The unpatched version of ghostpdl requires you to remove it by editing
main/pcl6_gcc.mak.  For people who do builds on several systems from a shared
NFS area, it is safer to control the options from a script (based on the version
of gcc) than by removing them from the make file (which removes them permanently
for all builds).
I know that RH 7.3 is old, but we still have a number of RH 7.3 systems to support.
Comment 5 Henry Stiles 2010-02-22 09:36:04 UTC
Looks good to me.  Assigning to Ralph for review and commit.
Comment 6 Hin-Tak Leung 2010-05-02 03:12:34 UTC
Grabbing a Ralph's bugs.
Comment 7 Hin-Tak Leung 2010-08-02 00:32:14 UTC
Re-assigning bugs which still have work to do.
Comment 8 Henry Stiles 2010-08-03 05:26:29 UTC
Thank you William, your patch is ghostpdl revision 11592.