Article View: gnu.g++.bug
Article #248g++/ndbm problem on Sparc (only ?)
From: Geir Pedersen
Date: Mon, 13 Apr 1992 20:19
Date: Mon, 13 Apr 1992 20:19
55 lines
1666 bytes
1666 bytes
I am having a problem with ndbm when being used by a g++ compiled
program on a sparc. It works fine on a Sun3, but gives a segmentation
violation on a sparc.
It works with
g++ version 1.40.3 (based on GCC 1.40)
on a Sun3, but fails with either of
g++ version 1.39.0 beta (based on GCC 1.39)
g++ version 1.40.3 (based on GCC 1.40)
on a sparc.
A small program to examplify follows below. The program will crash
with a segmentation violation in dbm_store().
As I need to get this working (:-), workarounds or fixes will be most
appreciated.
Thanks,
Geir Pedersen
====================
#include <stdio.h>
#include <fcntl.h>
extern "C" {
#include <ndbm.h>
}
DBM *ndbm;
main ()
{
datum key, content;
long ndbm_key;
int res;
char *foo = strdup ( "Fritjof" );
if ( !(ndbm = dbm_open ( "junk-ndbm", O_RDWR|O_CREAT, 0664 )) )
{
printf ( "Failed to open ndbm-file" );
exit ( 1 );
}
content.dptr = foo;
content.dsize = strlen(foo);
ndbm_key = 4711;
key.dptr = (char *) &ndbm_key;
key.dsize = 4;
res = dbm_store ( ndbm, key, content, DBM_INSERT );
printf ( "dbm_store()=%d\n", res );
}
Technical Details
Message-ID:
<1992Apr13.201929.5342@ulrik.uio.no>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ulrik.uio.no!geirpShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ulrik.uio.no!geirp From: geirp@ulrik.uio.no (Geir Pedersen) Subject: g++/ndbm problem on Sparc (only ?) Message-ID: <1992Apr13.201929.5342@ulrik.uio.no> Sender: gnulists@ai.mit.edu Organization: Center for Information Technology Services, University of Oslo, Norway Distribution: gnu Date: Mon, 13 Apr 1992 20:19:29 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 56