🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #762

bug with void pointer subtraction.

#762
From: Paul Hudson
Date: Tue, 18 Apr 1989 08:32
16 lines
882 bytes
The line 

print (void*)1 - (void*)0

causes gdb3.1 (sun3,os4) to give an arithmetic exception.  Presumably
it's trying to divide the difference by the size of the thing pointed
to, which is zero (although gcc thinks it's one, sometimes ;-).

Paul Hudson 

Snail mail: Monotype ADG	Email:	...!ukc!acorn!moncam!paul
	    Science Park,		paul@moncam.co.uk
	    Milton Road,	"Sun Microsysytems:
	    Cambridge,		 The Company is Arrogant (TM)"
	    CB4 4FQ
Technical Details
Message-ID: <8904180832.AA05140@marvin.moncam.uucp>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!moncam!paul

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!moncam!paul
From: moncam!paul@UUNET.UU.NET (Paul Hudson)
Newsgroups: gnu.gdb.bug
Subject: bug with void pointer subtraction.
Message-ID: <8904180832.AA05140@marvin.moncam.uucp>
Date: 18 Apr 89 08:32:41 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 16