🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87557

gmalloc.c ptrdiff_t botch (Emacs 19.26, Solaris 2.3, GCC 2.6.0)

#87557
From: Paul Eggert
Date: Wed, 14 Sep 1994 03:22
48 lines
2369 bytes
This is Solaris 2.3, GCC 2.6.0, Emacs 19.26 configured with:

	./configure --with-gcc --x-includes=/usr/openwin/include --x-libraries=/usr/openwin/lib

The build failed as follows:

	gcc -c  -Demacs -DHAVE_CONFIG_H  -I. -I/reb/src/base/emacs/src   -traditional  -I/usr/openwin/include      -g -O gmalloc.c
	gmalloc.c:1250: parse error before `ptrdiff_t'
	*** Error code 1
	make: Fatal error: Command failed for target `gmalloc.o'
	Current working directory /export/semi/src/base/emacs/src
	*** Error code 1
	make: Fatal error: Command failed for target `src/temacs'

The problem is that gmalloc.c uses ptrdiff_t, but the `-traditional'
option turns off __STDC__, so ptrdiff_t never gets defined.
(Neither __GNU_LIBRARY__ nor _LIBC is defined when compiling Emacs.)

Here is a patch.  I know gmalloc.c is an output file, but I
don't know what the corresponding input file is, so this is
the best I can do for now.

Wed Sep 14 02:46:45 1994  Paul Eggert  <eggert@twinsun.com>

	* src/gmalloc.c (ptrdiff_t): If !__STDC__, get ptrdiff_t
	from <stddef.h> if STDC_HEADERS and define it as int otherwise.

===================================================================
RCS file: src/gmalloc.c,v
retrieving revision 19.26
retrieving revision 19.26.1.1
diff -c -r19.26 -r19.26.1.1
*** src/gmalloc.c	1994/09/07 10:34:30	19.26
--- src/gmalloc.c	1994/09/14 02:46:45	19.26.1.1
***************
*** 83,88 ****
--- 83,93 ----
  #include <stddef.h>
  #define	__malloc_size_t	size_t
  #else
+ #if STDC_HEADERS
+ #include <stddef.h>
+ #else
+ #define ptrdiff_t int
+ #endif
  #define	__malloc_size_t	unsigned int
  #endif
  
Technical Details
Message-ID: <9409140313.AA18233@spot.twinsun.com>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!panix!MathWorks.Com!europa.eng.gtefsd.com!newsxfer.itd.umich.edu!uunet!cis.ohio-state.edu!twinsun.COM!eggert

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,ee293913e3287766,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-09-14 14:30:28 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!panix!MathWorks.Com!europa.eng.gtefsd.com!newsxfer.itd.umich.edu!uunet!cis.ohio-state.edu!twinsun.COM!eggert
From: eggert@twinsun.COM (Paul Eggert)
Newsgroups: gnu.emacs.bug
Subject: gmalloc.c ptrdiff_t botch (Emacs 19.26, Solaris 2.3, GCC 2.6.0)
Date: 13 Sep 1994 23:22:16 -0400
Organization: GNUs Not Usenet
Lines: 48
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9409140313.AA18233@spot.twinsun.com>