From: blair@snogum.cao.dec.com (Blair Phillips - Digital)
Subject: Re: Might this be a VMS or C problem on the AXP?
Date: Mon, 29 Mar 1993 02:43:07 GMT [thread overview]
Message-ID: <1993Mar29.024307.3711@dbased.nuo.dec.com> (raw)
In-Reply-To: dsmith.733265264@aa.cad.slb.com
In article <dsmith.733265264@aa.cad.slb.com>, 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}
next prev parent reply other threads:[~1993-03-29 2:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-03-27 20:47 Might this be a VMS or C problem on the AXP? J. Daniel Smith
1993-03-27 22:16 ` Marcus J Ranum
1993-03-27 22:17 ` Ron Natalie
1993-03-29 2:43 ` Blair Phillips - Digital [this message]
1993-04-02 13:45 ` J. Daniel Smith
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox