public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: tmpnam() core dumping
@ 1997-12-12 10:18 Bill Ahlbrandt
  1997-12-12 13:04 ` Per Bothner
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bill Ahlbrandt @ 1997-12-12 10:18 UTC (permalink / raw)
  To: 'law@cygnus.com'; +Cc: 'egcs@cygnus.com'

Yes, using -fwritable-strings fixes the problem.

I wonder why these functions want to modify the string that is passed to them :-)?

Thanks much... 

-----Original Message-----
From:	Jeffrey A Law [SMTP:law@hurl.cygnus.com]
Sent:	Friday, December 12, 1997 10:05 AM
To:	Bill Ahlbrandt
Cc:	egcs@cygnus.com
Subject:	Re: tmpnam() core dumping 


  In message < 01BD06D5.E1EF50C0@bill.icdata.com >you write:
  > This probably has nothing to do with egcs, but being extremely new this env
  > ironment and compiler, any assistance will be much appreciated.
  > 
  > Note that the tempnam function works just fine.
Does -fwritable-strings fix the problem.

From the GCC manual:
@itemize @bullet
@cindex string constants
@cindex read-only strings
@cindex shared strings
@item
GNU CC normally makes string constants read-only.  If several
identical-looking string constants are used, GNU CC stores only one
copy of the string.

@cindex @code{mktemp}, and constant strings
One consequence is that you cannot call @code{mktemp} with a string
constant argument.  The function @code{mktemp} always alters the
string its argument points to.


This may also apply to tempnam.

jeff



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-12-15  2:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-12 10:18 tmpnam() core dumping Bill Ahlbrandt
1997-12-12 13:04 ` Per Bothner
1997-12-12 14:32 ` [EGCS] " Marc Lehmann
1997-12-12 15:46 ` Tim Hollebeek
1997-12-15  2:51 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).