Hi, On Fri, Dec 27, 2019 at 10:26:24PM +0800, 瞿兴 wrote: > In section 6.7.8 of the C99 draft document defines : > > If an attempt is made to use pointer variable p to modify the contents of the > array, the behavior is undefined. > > When executing the testcase(in the attachment), tinyc does not report an > error and modify the value of the variable NISLParameter0 successfully
Well, "undefined behavior" allows tinycc to do this. > The attachment includes the relevant testcase. IMHO the only thing tinycc should do is to warn that a const char * has been implicitly cast to char * in the initialization of NISLParameter0. Putting string literals into read-only sections is a nice to have. > char *NISLParameter0 = "abcdefghij"; Best regards, Daniel _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
