1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00
cde/cde
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
..
admin Install /usr/local/libdata/ldconfig/cde for FreeBSD 2012-09-25 11:33:09 -06:00
config Add csu objects to shared libraries on OpenBSD. 2012-09-25 11:37:23 -06:00
contrib contrib/xinetd: xinetd file for cmsd and ttsdbserver 2012-09-23 19:32:17 -06:00
databases Dtlogin logo for FreeBSD 2012-09-25 11:35:29 -06:00
doc Process sgml and man files in doc directory for FreeBSD. 2012-08-15 15:56:03 -06:00
examples 2 warnings fixed (64-bit) 2012-09-24 18:35:24 -06:00
historical historical: mv some old files that we want to preserve out of the top level 2012-08-10 07:17:27 -06:00
imports/motif message catalogs: fix comment lines, also remove linux hack in merge.c 2012-09-03 15:12:57 -06:00
include XmPrivate.h: never try to build this automatically. 2012-09-29 20:46:27 -06:00
lib Don't break help with gcc -O2 2012-10-01 18:59:14 -06:00
logs Initial import of the CDE 2.1.30 sources from the Open Group. 2012-03-10 18:21:40 +00:00
osf Correction of paths for BSDs 2012-08-29 20:39:02 -06:00
programs dtcreate: Don't crash when clicking "Find Set..." 2012-09-30 11:11:21 -06:00
util Add GNU LGPL headers to all .c .C and .h files 2012-03-10 18:58:32 +00:00
.gitignore Allow building on FreeBSD 2012-09-06 11:17:43 -06:00
CONTRIBUTORS Update CONTRIBUTORS file. 2012-09-05 19:38:24 -06:00
COPYING Addition of LGPL file at top level, deprecation of file copyright, and 2012-05-29 16:54:57 +01:00
copyright Add in a CONTRIBUTORS file for all people that have made changes post 2012-07-24 15:23:16 +01:00
HISTORY add HISTORY file 2012-09-06 13:33:58 -06:00
Imakefile Imakefile diffs for OpenBSD. 2012-08-11 19:23:43 -06:00
Makefile Increment CDE version number to 2.2.0 2012-07-16 15:23:40 +01:00
README Update README file 2012-09-06 12:12:15 -06:00

*************************************

The Common Desktop Environment is released under the terms of the LGPL
V.2 license. You may reuse and redistribute this code under the terms
of this license. See the COPYING file for details.

*************************************
Purpose of this release:

This release of CDE under a new opensource license is numbered
starting at version 2.2.0.

************************************
Downloading this release:

CDE may be downloaded in source form from the Common Desktop
Environment website:

http://sourceforge.net/projects/cdesktopenv/

Or via git:

git clone git://git.code.sf.net/p/cdesktopenv/code cdesktopenv-code

The git repository will always be more up to date than the
downloadable tarballs we make available, so if you have problems,
please try the latest version from git master.

************************************
Installing this release:

Complete build and installation instructions can be found on the CDE
wiki:

http://sourceforge.net/p/cdesktopenv/wiki/Home/

Please go there and read the appropriate section(s) for your OS (Linux
or FreeBSD/OpenBSD/NetBSD currently).  There are a variety of
dependancies that must be met, as well as specific set up steps
required to build.

Do not expect to just type 'make' and have it actually work without
meeting the prerequisites and following the correct steps as spelled
out on the wiki. :)

There are also a lot of other documents and information there that you
might find useful.

************************************
Support: 

You can join the development mailing list here:

https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

There is a CDE IRC channel on chat.freenode.net, channel #cde

Bug reports and patches encouraged.