From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f8a1,bda6136a6fefc8c6 X-Google-Attributes: gid10f8a1,public X-Google-Thread: 1164f8,bda6136a6fefc8c6 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-03-28 18:54:52 PST Xref: sparky vmsnet.alpha:380 comp.sys.dec:8122 Newsgroups: vmsnet.alpha,comp.sys.dec Path: sparky!uunet!caen!malgudi.oar.net!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!decwrl!deccrl!news.crl.dec.com!dbased.nuo.dec.com!news From: blair@snogum.cao.dec.com (Blair Phillips - Digital) Subject: Re: Might this be a VMS or C problem on the AXP? Message-ID: <1993Mar29.024307.3711@dbased.nuo.dec.com> Sender: news@dbased.nuo.dec.com (USENET News System) Reply-To: Blair@snogum.cao.dec.com Organization: Digital Equipment Corporation References: Date: Mon, 29 Mar 1993 02:43:07 GMT In article , dsmith@ann-arbor.applicon.slb.com (J. Daniel Smith) writes: >According to the ANSI spec, > "If a program attempts to modify a string literal..., the behavior > is undefined". (Section 3.1.4) >so, strickly speaking, I guess this can't be considered a bug. Still, >it is a bit surprising to me that it does get detected and cause a >failure on the AXP/VMS, especially since it does not crash under >VAX/VMS. > >Can someone explain excatly what is happening on the AXP/VMS? Is >there a way to make this program crash under VAX/VMS (or other >platforms)? Can't help you make it crash on other platforms, but there is a switch to make it work on AXP/VMS: $ CC/ASSUME=[NO]WRITEABLE_STRING_LITERALS By default, string literals are defined in a readonly PSECT by DEC C. The /ASSUME=WRITEABLE_STRING_LITERALS switch (aka "Aid to brain-dead programs") puts them in a read-write PSECT. ---------- Blair Phillips Blair.Phillips@cao.mts.dec.com Digital Equipment Corp (Aust) P/L Phone: (+61 6) 2754874 Canberra, Australia FAX : (+61 6) 2473654 X.400: "C=AU; A=OTC; P=Digital; O=Digital; OU=SNO; S=Phillips; G=Blair" {Any opinions expressed are my own, not those of Digital Equipment Corporation}