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-04-02 07:10:40 PST Xref: gmd.de vmsnet.alpha:387 comp.sys.dec:6736 Newsgroups: vmsnet.alpha,comp.sys.dec Path: gmd.de!ira.uka.de!math.fu-berlin.de!aa.cad.slb.com!aa.cad.slb.com!dsmith From: dsmith@ann-arbor.applicon.slb.com (J. Daniel Smith) Subject: Re: Might this be a VMS or C problem on the AXP? Organization: Applicon, Inc.; Ann Arbor, MI (USA) Date: Fri, 2 Apr 1993 13:45:07 GMT References: <1993Mar29.024307.3711@dbased.nuo.dec.com> Message-ID: In <1993Mar29.024307.3711@dbased.nuo.dec.com> blair@snogum.cao.dec.com (Blair Phillips - Digital) writes: >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)? >[...] >$ 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. Of course I changed the code so it was no longer a "brain-dead program". Thanks to all those who explained about the writable PSECT under VMS. Dan -- ==== message is author's opinion only -- it is not an official statement ==== J. Daniel Smith dsmith@ann-arbor.applicon.slb.com Applicon, Inc. dsmith@aaaca1.sinet.slb.com Ann Arbor, Michigan (USA) AAACA1::DSMITH (SINet)