So does this mean it is illegal to give as a gift a gun which was previously purchased? If not, what difference would it make if the gun were purchased specifically as a gift?
No, it comes down to intent. If I buy a gun for myself then later on decide to give it to someone else, that's legal. If I buy it with the intent of transferring it to someone else, it's a straw purchase. I actually do think that Sarah may be correct about an exemption when buying a firearm as a gift for a non-prohibited family member though, but I'm not 100% sure of that -- the BATF forms are pretty clear about buying it for yourself, and I don't think you can say "no" to that question and still buy the firearm.