If you are socially conscientious, you may be concerned that you are investing with companies who are selling guns. That being said, there are a wide range of organizations, and some sell different weapons than others: For instance, Cabela's only sells a certain type of gun to its customers, and these are clearly intended solely for hunting and target shooting.
On the other hand, there are companies that sell weapons intended for war. Some organizations are extremely clear about their products, while others are not exactly transparent.
For instance, there are usually at least a few businesses in most index funds that sell guns.
Unfortunately, this is extremely difficult to avoid, although it's not impossible. If you are simply investing on your own, you can alleviate the problem by simply researching each individual company you invest in and practicing an abundance of caution before you purchase an index fund: the S&P 500 does, indeed, contain stocks of companies selling weapons of mass destruction.
On the other hand, if you are investing in your retirement fund, matters might become more complicated. Thankfully, you are probably only minimally invested in guns if at all, but there is still a small chance that you are. You can often adjust your preferences to stocks and bonds that are solely from socially ethical companies and, although the definition of "ethical" is rather subjective, there's a good chance this will significantly decrease any monetary support you are providing to companies who are selling firearms.
Of course, you can always call whichever company your retirement funds are with if they are not being transparent enough about where your money is going and who it is supporting, and let them know about your concerns, although it's important to be as polite as possible when approaching this matter.