[PATCH v2 0/2] Use const whenever we point to literal strings (take 1)

2021-05-18 Thread Julien Grall
From: Julien Grall Hi all, By default, both Clang and GCC will happily compile C code where non-const char * point to literal strings. This means the following code will be accepted: char *str = "test"; str[0] = 'a'; Literal strings will reside in rodata, so they are not modifiable. T

Re: [PATCH v2 0/2] Use const whenever we point to literal strings (take 1)

2021-05-26 Thread Julien Grall
On 18/05/2021 15:01, Julien Grall wrote: From: Julien Grall Hi all, By default, both Clang and GCC will happily compile C code where non-const char * point to literal strings. This means the following code will be accepted: char *str = "test"; str[0] = 'a'; Literal strings will