On 10/29/07, Michael Gogins wrote: > I DON'T think 'char *mystring = "xxxx"' should be replaced with 'char mystring[] > = "xxx"' for the sake of const correctness! Then, we wouldn't necessarily KNOW > that somebody was trying to write to the string. We WANT it to crash so we will > find out where and why somebody is doing this. Actually, what we want is a strcpy(mystring, "xxxx"). A char mystring[] = "xxxx" might crash because the "xxxx" string could be deallocated after the function ends. There are sections that are writing to memory pointed by csound structures, and that either should be allowed (and thus not use string = "xxxx"), or forbidden (marking the sections as const). AFAICS, this is not explicited anywhere. IIRC, the compiler will generate additional optimizations when dealing with const datatypes (for example, sticking the values directly in the assembler instead of referencing memory), which is another reason for aiming for const-correctness. -- Felipe Sateler ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net