My Dad said during WWII you were not allowed to salute the officer for same reason
In combat it would invite a sniper's bullet for the officer.
I think the modern rules during combat are the same. (I have never been to an active combat zone.) Everyone wears subdued (embroidered on cloth rather than shiny metal) ranks for that reason, too.