It is undefined behavior to do this?
char *a = "hello";
char b[] = "abcd";
a = b;
My compiler throws no warning, with the maximum warning level.
There is no UB here. You are simply re-assigning a pointer to point at the address of the start of the array instead.
Note that you are not actually modifying the value that a is pointing at, only a itself, and a is a normal char *.