const debacle

Bill Baxter dnewsgroup at billbaxter.com
Mon Mar 24 09:10:42 PDT 2008


Janice Caron wrote:
> On 24/03/2008, Janice Caron <caron800 at googlemail.com> wrote:
>>  I'd call that a bug in your C compiler, because if that compiles, so
>>  will the following:
> 
> Ah rats! Ignore the typo. I meant:
> 
>     void f(char const * s)
>     {
>         char * t = substring(0, s);
>         t[0] = 'x';
>     }

Probably "my compiler" will let that through.  That's what I mean by not 
caring if the detection of const violations is 100%.  It's still more 
error checking than what Python and Java developers get.  I can 
understand if some folks want to argue that's not enough.  I'm just 
saying I think it would be enough for me.

--bb



More information about the Digitalmars-d mailing list