Hi,
with xemacs-21.2 CVS from October 12 and Compaq C V6.2-504 I get
[...]
checking for working alloca.h... no
checking for alloca... no
Defining C_ALLOCA
checking whether alloca needs Cray hooks... no
checking stack direction for C alloca... -1
Defining STACK_DIRECTION = -1
xemacs will be linked with "alloca.o"
[...]
The reason is that ccc won't find alloca when linking if passed
"-std1", which is added by xemacs configure. (ccc picks up gcc's
alloca.h, but the alloca.h check wants to link, too, so it fails.)
Then when building one gets lots of warnings:
ccc -O3 -Demacs -I. -I../src -I/usr/local/src/xemacs-21.2-10.12/lib-src
-I/usr/local/src/xemacs-21.2-10.12/src -DHAVE_CONFIG_H -std1
/usr/local/src/xemacs-21.2-10.12/lib-src/wakeup.c -ldb -lgpm -lncurses -L/usr/lib -lesd
-laudiofile -lm -lm -lutil -lgcc -lc -lgcc /usr/lib/crtn.o -o wakeup
cc: Warning: /usr/include/alloca.h, line 33: In this declaration, the type of the function
"alloca", declared in a system header file, is not compatible with the earlier
declaration of "alloca" at line number 43 in file ../src/config.h.
(funcredeclext1)
extern __ptr_t alloca __P ((size_t __size));
---------------^
(__ptr_t is a #define for void *, while config.h declares the return
value as char *)
Finally, it fails:
ccc -c -O3 -Demacs -I. -I../src -I/usr/local/src/xemacs-21.2-10.12/lib-src
-I/usr/local/src/xemacs-21.2-10.12/src -DHAVE_CONFIG_H -std1
/usr/local/src/xemacs-21.2-10.12/lib-src/../src/alloca.c
cc: Error: /usr/local/src/xemacs-21.2-10.12/lib-src/../src/alloca.c, line 191: In this
declaration, the type of "alloca" is not compatible with the type of a previous
declaration of "alloca" at line number 43 in file ../src/config.h. (notcompat)
alloca (size)
^
because alloca.c declares alloca as returning "pointer", which is
typedefed to void *.
Now I wonder how to fix this best; one could for example:
* remove -std1 from the ccc flags
* use something like
#if defined(__DECC) && defined(__linux__)
# include <machine/builtins.h>
# define alloca __ALLOCA
#endif
which also works with -std1
* consistentialize xemacs' declarations; regex.c also wants to declare
alloca as returning char *.
And if anybody feels a bit bored, here are a few interesting warnings:
cc: Warning: miscplay.c, line 384: In this statement, the expression
"*dest++=(unsigned char)(((int)*((signed char ...)(src++))+(int)*((signed char
...)(src++)))/2)" modifies the variable "src" more than once without an
intervening sequence point. This behavior is undefined. (undefvarmod)
*dest++ = (unsigned char)(((int)*((signed char *)(src++)) +
----^
cc: Warning: miscplay.c, line 405: In this statement, the expression
"*dest++=(unsigned char)(((int)*((signed char ...)(src++))+(int)*((signed char
...)(src++)))/2)^0X0000000000000080" modifies the variable "src" more than
once without an intervening sequence point. This behavior is undefined. (undefvarmod)
*dest++ = (unsigned char)(((int)*((signed char *)(src++)) +
----^
cc: Warning: miscplay.c, line 496: In this statement, the expression
"*p++=ulaw_dsp[*p]" modifies "p", and fetches its value in a
computation that is not used to produce the modified value without an intervening sequence
point. This behavior is undefined. (undefvarfetch)
*p++ = ulaw_dsp[*p];
----^
cc: Warning: miscplay.c, line 570: In this statement, the expression
"*p++=((*p&0X00000000000000FF)<<8)|(*p>>8)" modifies
"p", and fetches its value in a computation that is not used to produce the
modified value without an intervening sequence point. This behavior is undefined.
(undefvarfetch)
*p++ = ((*p & 0x00ff) << 8) | (*p >> 8);
----^
cc: Warning: miscplay.c, line 570: In this statement, the expression
"*p++=((*p&0X00000000000000FF)<<8)|(*p>>8)" modifies
"p", and fetches its value in a computation that is not used to produce the
modified value without an intervening sequence point. This behavior is undefined.
(undefvarfetch)
*p++ = ((*p & 0x00ff) << 8) | (*p >> 8);
----^
cc: Warning: regex.c, line 5627: This statement uses the type "union declared without
a tag" to reference the same storage location as the statement at line number 5627 in
file regex.c, which uses the type "long". This does not conform to the ANSI
aliasing rules. (badansialias)
POP_FAILURE_POINT (d, p,
----------^
cc: Warning: regex.c, line 5312: This statement uses the type "union declared without
a tag" to reference the same storage location as the statement at line number 5312 in
file regex.c, which uses the type "long". This does not conform to the ANSI
aliasing rules. (badansialias)
POP_FAILURE_POINT (sdummy, pdummy,
------------^
Falk