🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #53495

sscanf bus error

#53495
From: J.D. Laub
Date: Mon, 04 Nov 1991 18:37
35 lines
1608 bytes
Any idea why the sscanf below core dumps (bus error) when the
following program is compiled with gcc version 1.39?
-------- cut here ---------
#include <stdio.h>
main()
{
   int n, i;
   float x;
   char name[50];
   n = sscanf ("25 54.32E-1 thompson", "%d%f%s", &i, &x, name);
}
-------- cut here ---------

I'm running SCO 3.2 version 2 on a Compaq 386 Systempro.  We've been
using gcc for months now on hundreds of thousands of lines of code
with no problems whatsoever until this.  The supplied compiler works
fine, and things work fine on our HP machines with their compilers.
DJ Delorie says he couldn't get 1.40 to fail (on MS-DOS?).

The example is from the man page.  Things work fine if I pass in a
buffer containing the string to the scan rather than the constant.

Thanks for any help.
-- 
J.D. Laub   a.k.a.   Laubster
ARPA:  jdl@iccdev.indcomp.com
UUCP:  ...!{emory,gatech}!iccdev!jdl
VOICE: 404-255-8336   FAX: 404-255-0602


-- 
J.D. Laub   a.k.a.   Laubster
ARPA:  jdl@iccdev.indcomp.com
UUCP:  ...!{emory,gatech}!iccdev!jdl
VOICE: 404-255-8336   FAX: 404-255-0602
Technical Details
Message-ID: <627@iccdev.indcomp.com>
Path: arc1-ca.pugleaf.net!gmdzi!zeus.ieee.org!sdd.hp.com!spool.mu.edu!sol.ctr.columbia.edu!emory!iccdev!jdl

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,367dc0f72abf4f9,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1991-11-04 11:43:22 PST
Path: arc1-ca.pugleaf.net!gmdzi!zeus.ieee.org!sdd.hp.com!spool.mu.edu!sol.ctr.columbia.edu!emory!iccdev!jdl
From: jdl@iccdev.indcomp.com (J.D. Laub)
Newsgroups: gnu.gcc.help
Subject: sscanf bus error
Message-ID: <627@iccdev.indcomp.com>
Date: 4 Nov 91 18:37:23 GMT
Organization: Industrial Computer Corp., Atlanta, GA
Lines: 35