🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #8791

minor bug in cast to (void()) gdb-4.5

#8791
From: Pierre Willard
Date: Wed, 09 Dec 1992 19:25
20 lines
1347 bytes
psi:/usr2/uunet:gdb
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.5, Copyright 1992 Free Software Foundation, Inc.
(gdb) p (void()) 0
Invalid cast.
(gdb) p (void()) '1'
$1 = {void ()} 0
(gdb)

gdb-4.5 allows casting of char to function, but not anything else.
This is because the TYPE_LENGTH of a TYPE_CODE_FUNC is 1. Note
also that the address of the casted function is 0 (not '1').

I think gdb should NOT allow any cast to a TYPE_CODE_FUNC. In that
case, it is just necessary to add a test in value_cast() in valops.c.

Regards
Pierre Willard
Technical Details
Message-ID: <9212091925.AA24850@_la.tce.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!la.tce.COM!pierre

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,2cd8e6527040ac77,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1992-12-09 18:27:58 PST
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!la.tce.COM!pierre
From: pierre@la.tce.COM (Pierre Willard)
Subject: minor bug in cast to (void()) gdb-4.5
Message-ID: <9212091925.AA24850@_la.tce.com>
Sender: gnulists@ai.mit.edu
Reply-To: pierre@la.tce.com
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 9 Dec 1992 19:25:51 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 21