Quote: "(but it doesn't matter as you shouldn't rely on the compiler to produce the same results here as unless I'm mistaken it's not defined in the C standard for strings like this to have the same address, why should they?)"
You're right, but see this taken from
here:
Quote: "Whether all string literals are distinct (that is, are stored in nonoverlapping objects) is implementation-defined"
The reason some compilers give string pooling as an option is probably because it saves space. After all there's no point in using distinct storage for string constants that are the same.
I agree with what Lilith said, although I'd like to add that it is in one case possible to compare via pointers, but both pointers must point to string literals, and string pooling must be enabled. There are no exceptions.