spir:

> Do you know more about why/how the above fails?

It's simple. A string (or array) is a 2-words long struct that contains a 
pointer to the data and a size_t length. Default struct equality just compares 
the bits of those two fields. In the above example I have created f1 and f2 
using two strings that have the same contents and lengths, but the pointers are 
different, because they are generated at run-time (normally the compiler uses a 
pool of shared string literals), so the equality fails.

I have asked Walter to fix this problem with strings and arrays probably three 
years ago or more, it's not a new problem :-)

Bye,
bearophile

Reply via email to