🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1832

Re: core dumper under GCC 1.30

#1832
From: Ken Raeburn
Date: Wed, 19 Oct 1988 19:23
24 lines
1045 bytes
The problem you describe stems from the fact that sscanf (at least in
some stdio implementations) wants to write into one of the strings
passed.  The dpANS C spec says that literal string arguments are not
writable; therefore the string that sscanf tries to write is not in a
writable portion of the program image.

This problem is listed in the GNU CC documentation, in the section
"Incompatibilities of GNU CC".

Try either doing something like

	main () {
	int y, m, d;
	char format[] = "%d";

	/* ... */
	sscanf (&date[7], format, &y);
	/* ... */
	}

(preferable) or compiling with "-fwritable-strings".

-- Ken
Technical Details
Message-ID: <8810191923.AA25556@MULTICS.MIT.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!ATHENA.MIT.EDU!raeburn

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!ATHENA.MIT.EDU!raeburn
From: raeburn@ATHENA.MIT.EDU (Ken Raeburn)
Newsgroups: gnu.gcc.bug
Subject: Re: core dumper under GCC 1.30
Message-ID: <8810191923.AA25556@MULTICS.MIT.EDU>
Date: 19 Oct 88 19:23:42 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 23