I think you're being naive. If you have a peer who works less than you (or whom you think is not as good as you are) and that peer is making more money than you, you will get pissed. It will impact your work, it will make you resentful and you will want to renegotiate your compensation. Either way, it will impact your work, probably your happiness, and it will force the company to deal with you instead of dealing with its business.
Keeping salaries confidential solves all these problems.
Only if the salary is the only way in which your peer is being rewarded.
These sorts of hostilities exist quite frequently in companies that don't share salary information, because rewards exist in lots of forms, including promotion, project assignments, shift scheduling, etc.
Imagine a company that decided to keep promotions secret to avoid hostilities.
I think you just described Valve and similar "flat organizations".
There's two developers in our mixed group, of which I am one. The other makes a moderate amount more than me. However, he is much more senior than me, and to be honest, a better coder too, so it's understandable. My gripe is that I think we're both underpayed and I think we both deserve a healthy raise. I wish he was motivated to ask for one instead of just taking the yearly cost-of-living increases so that I might ask for one myself. And that annoys me greatly sometimes. I have yet to be hostile though. :)
Surely having the public record is in your favour because you can point to similar jobs that pay more.
anyway I always treated policies more as suggestion than binding contracts, since I never sign on those.
I've been in workplaces where everyone know each others salaries. Development shared sql database with the hr department so the "information leakage" was obvious. But nobody cared and it didn't lead to a hostile work environment.
I cant say knowing what your coworkers make never leads to hostile work environments. I can only say that I find it illogical that it would (why would it piss you off if someone negotiated a good deal?), have never heard of any work environment becoming hostile because of it or experienced it myself.