Leif Andersson writes:
When I configure and build 21.5.28 on a Fedora-6 system, fully
updated,
I get a few warnings both from configure
Ah, thanks. They're ignorable. Eventually we'll do something to shut
them up. :-)
Please send the Installation file produced by configure. It gives us
some useful information about your system, like glibc version and GCC
version, and things that are autodetected but not mentioned in your
configure flags.
/tmp/leif/xemacs-21.5.28/lib-src/ootags.c: In function
'C_entries':
/tmp/leif/xemacs-21.5.28/lib-src/ootags.c:2642: warning:
'savetok.buffer' may be used uninitialized in this function
Hm. I don't recall these. I'll take a look.
gcc -c -Wall -Wno-switch -Wundef -Wsign-compare -Wno-char-subscripts
-Wpacked -Wunused-parameter -g -O3 -Demacs -I.
-I/tmp/leif/xemacs-21.5.28/src -DHAVE_CONFIG_H -I/usr/include/freetype2
You may want to get rid of the unsafe optimizations with
--fno-strict-aliasing. I thought we did this ourselves in configure
(we do for IBM's xlc compiler, for example), but it appears not.
Apple's GCC disables them by default, which is why I don't see these
warnings, I guess.
/tmp/leif/xemacs-21.5.28/src/console.c
/tmp/leif/xemacs-21.5.28/src/console.c: In function 'Fset_input_mode':
/tmp/leif/xemacs-21.5.28/src/console.c:1146: warning: dereferencing
type-punned pointer will break strict-aliasing rules
The GCC info manual has an explanation of this. Search for
-fstrict-aliasing. Briefly, consider
char *s = "abcd";
int *ip = & (int *) s;
int i = *ip;
*ip is aliasing *s. The value of i will be a large negative number,
but you need to know endianness to predict what it will be. This is
just one of the many ways aliasing can be dangerous.
Type punning occurs when a union contains members of different types,
and the type that is read is different from the one that was most
recently written. In builds configured with --with-union-type,
the basic Lisp_Object is something like this:
enum Lisp_Object_Layout { TYPE_POINTER = 0,
TYPE_FIXNUM_EVEN = 1,
TYPE_CHARACTER = 2,
TYPE_FIXNUM_ODD = 3,
TYPE_FIXNUM_ANY = 1 };
union Lisp_Object {
struct { int junk :30; int type :2 } generic;
struct { int val :30; int type :2 } character;
struct { int val :31; int type :1 } fixnum;
struct { lrecord *val; } lrecord;
} x;
and code will do this kind of thing:
{
union Lisp_Object x;
x.fixnum.val = 10;
x.fixnum.type = TYPE_FIXNUM_ANY;
switch (x.generic.type) /* pun! */
{
case TYPE_LRECORD:
/* handle structured object */
break;
case TYPE_FIXNUM_ODD:
case TYPE_FIXNUM_EVEN:
/* handle integer */
break;
case TYPE_CHARACTER:
/* handle character */
break;
default:
abort ();
}
}
Now, you don't have --with-union-type, so I'm not sure the exact
mechanism causing the warnings you see. I'll have to try on a Linux
box.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta