cdesktopenv/cde/lib/DtHelp
Marcin Cieslak 775fb0f0f1 Don't break help with gcc -O2
libDtHelp is unable to read SDL help files
with -ftree-store-ccp optimization which
is enabled by -O2 on gcc 4.2.1.

GifUtils.c and decompress.c didn't work
properly with -ftree-store-ccp enabled.

GifUtils.c was repaired by fixing
those warnings:

GifUtils.c: In function 'create_pixmap':
GifUtils.c:1093: warning: return makes integer from pointer without a cast
GifUtils.c:1110: warning: return makes integer from pointer without a cast
GifUtils.c:1215: warning: return makes integer from pointer without a cast
GifUtils.c: In function 'gif_to_pixmap':
GifUtils.c:1242: warning: return makes integer from pointer without a cast

decompress.c didn't generate warnings, but the
only effect of the -ftree-store-cpp was to introduce
this change:

        addq    $1, %rax
        movq    %rax, (%rbx)
 .L90:
-       cmpl    $157, %edx
+       cmpl    $-99, %edx
        jne     .L86
        movl    8(%rbx), %eax
        subl    $1, %eax

Which corresponds to this source code:

bufioI.h

     57 #define BufFileGet(f)   ((f)->left-- ? *(f)->bufp++ : (*(f)->io) (f))

     42     int     (*io)(/* BufFilePtr f */);

decompress.c
     53 #ifdef NO_UCHAR
     54  typedef char   char_type;
     55 #else
     56  typedef        unsigned char   char_type;
     57 #endif /* UCHAR */
     58
     59 static  char_type magic_header[] = { "\037\235" };      /* 1F 9D */

    131     if ((BufFileGet(f) != (magic_header[0] & 0xFF)) ||
    132         (BufFileGet(f) != (magic_header[1] & 0xFF)))
    133     {
    134         return 0;
    135     }

BufFileGet() returns (int), so the (unsigned char) constants
got promoted to (int) with sign extension; therefore constant
157 decimal (0x9D) became -99 decimal, sign extended
(0xffffff9D), and the comparison was always false.

Tested using:
$ gcc -v
Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]

Running on:
FreeBSD 10.0-CURRENT (r240948M)
built Wed Sep 26 23:33:08 CEST 2012
2012-10-01 18:59:14 -06:00
..
il 157 warnings: remove -DXK_MISCELLANY from Makefiles 2012-09-24 18:30:21 -06:00
jpeg 157 warnings: remove -DXK_MISCELLANY from Makefiles 2012-09-24 18:30:21 -06:00
AIX.lcx Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
Access.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Access.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
AccessCCDF.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
AccessCCDFI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
AccessCCDFP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
AccessI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
AccessP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
AccessSDL.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
AccessSDLI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
AccessSDLP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Actions.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
ActionsI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
AsciiSpc.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
AsciiSpcI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CCDFUtil.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CCDFUtilI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CDE.lcx Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
Callbacks.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CallbacksI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Canvas.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CanvasError.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CanvasI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CanvasOs.c Add in extra args required for open() on Linux 2012-03-11 16:33:18 +00:00
CanvasOsI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CanvasP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CanvasSegP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CleanUp.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CleanUpI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CvString.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CvStringI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
CvtToArrayP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Destroy.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
DestroyI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
DisplayAreaI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
DisplayAreaP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
DtHelp.msg message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
Environ_c.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FileListUtils.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FileListUtilsI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FileUtils.c FileUtils.c: fix CERT VU#575804 2012-05-26 18:14:58 -06:00
FileUtilsI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Font.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FontAttr.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FontAttrI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FontI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Format.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FormatCCDF.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FormatCCDFI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FormatI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FormatMan.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FormatManI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FormatSDL.c dthelp: Avoid undefined behaviour in strcpy 2012-09-29 19:21:27 -06:00
FormatSDLI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FormatTerm.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FormatUtil.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FormatUtilI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
FreeBSD.lcx Process sgml and man files in doc directory for FreeBSD. 2012-08-15 15:56:03 -06:00
GenUtils.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
GenUtilsP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
GifUtils.c Don't break help with gcc -O2 2012-10-01 18:59:14 -06:00
GifUtilsI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
GlobSearch.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
GlobSearchI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
GlobSearchP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Graphics.c Get rid of malloc.h. 2012-08-12 14:20:58 -06:00
GraphicsI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
GraphicsP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HP-UX.lcx Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
Help.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpAccess.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpAccessI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpDialog.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpDialog.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpDialogI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpDialogImageI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpDialogP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpErrorP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpQuickD.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpQuickD.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpQuickDI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpQuickDP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpTermP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpUtil.c 157 warnings: remove -DXK_MISCELLANY from Makefiles 2012-09-24 18:30:21 -06:00
HelpUtilI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpXlate.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelpXlate.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Helpos.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HelposI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
History.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HistoryI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HourGlass.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HourGlassI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HyperText.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
HyperTextI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Imakefile 157 warnings: remove -DXK_MISCELLANY from Makefiles 2012-09-24 18:30:21 -06:00
JpegUtils.c Get rid of malloc.h. 2012-08-12 14:20:58 -06:00
JpegUtilsI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Layout.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
LayoutUtil.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
LayoutUtilI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
LinkMgr.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
LinkMgrI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
LinkMgrP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Linux.lcx doc/help localization changes 2012-06-18 22:01:02 -06:00
Lock.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Messages.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
MessagesP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
OSF1.lcx Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
Obsolete.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
ObsoleteP.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
OpenBSD.lcx Process sgml and man files in doc directory for FreeBSD. 2012-08-15 15:56:03 -06:00
PathArea.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
PathAreaI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Print.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
PrintI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
RegionI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Resize.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
ResizeI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
SDLI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
Selection.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
SelectionI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
SetList.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
SetListI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
StringFuncs.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
StringFuncsI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
SunOS.lcx Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
UNIX_SV.lcx Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
UNIX_Syst.lcx Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
UtilSDL.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
UtilSDLI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
VirtFuncs.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
VirtFuncsI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
VolSelect.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
VolSelectI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
XInterface.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
XInterfaceI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
XUICreate.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
XUICreateI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
XbmUtils.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
XbmUtilsI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
bufio.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
bufioI.h Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
comment.txt Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
decompress.c Don't break help with gcc -O2 2012-10-01 18:59:14 -06:00
fmt_tbl.msg message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
libDtHelp.elist Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
mapfile.reorder Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
version.c Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00