httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgau...@hotwired.com (Dean Gaudet)
Subject Re: cvs commit: apache/src mod_proxy.c (fwd)
Date Wed, 03 Jul 1996 23:45:03 GMT
In article <hot.mailing-lists.new-httpd-9607031916.aa22088@gonzo.ben.algroup.co.uk>,
Ben Laurie  <new-httpd@hyperreal.com> wrote:
>"xyyzy"[0]='a';
>
>is legal, if bizarre, C. That may seem like a tangent, but it isn't (honest).

It's been a few years since I worked on C compilers, but my memory of
the ANSI standard says this isn't legal ANSI C.  It's fine in K&R though.
Many compilers have options that let you say whether string constants should
be put in writable or non-writable memory regions.

>From man gcc:

       -fwritable-strings
              Store string constants in the writable data segment
              and don't uniquize them.  This is for compatibility
              with  old programs which assume they can write into
              string constants.  `-traditional' also has this ef-
              fect.

              Writing  into  string constants is a very bad idea;
              "constants" should be constant.


Dean

Mime
View raw message