The only problem cleaning with WD-40 is if some of it comes in contact with your ammunition, say you don't get it all out of your chamber or bolt face. It does work great at fending off moisture; that's what it's designed to do. WD-40 will destroy ammunition, however. It's what we use at work to kill old turn in ammunition that nobody wants.
I use the Eezoxx (or however it's spelled) and have been using it for about 10 years. It works as a cleaner (so so), lubricant and preservative and in tests on another page, it had the best corrosion resistance on bare metal. It is harder to find than Hoppe's or breakfree, but it's worth the hunt. I just wish that the pressurized cans had more gas. It seems that they always run out of pressure before the can's empty. (gonna puncture the can I have now and put the rest into an oiler)
(Just realized that the links Quickdtoo posted has the same test I saw)
As an aside, a friend of mine is rough on his guns. His deer gun is a Win. 70 in .25-06. He said it was never really accurate, (bought used from a friend) shooting 3-4" groups @100. I took it, (after watching him hunt with it for 8 years) went to clean it and found that you could barely see down the barrel, due to all the powder fouling and mung. I cleaned the barrel with boretech carbon cleaner then their Eliminator (cheap plug, sorry!) and found that there was what I considered a decent amount of rust in the grooves. I then scrubbed the barrel with a bronze brush and Kroil (Can't use bronze brushes with eliminator, it eats em) and let it sit for a few hours, then repeated. Did this a couple of times, and although it didn't remove all the pitting from the rust, it removed most of it.
We went out to the range and shot some federal premium ammo and it gave 2" groups. I loaded some Sierra gamekings for it and it then shot 1" groups. We stopped there and packed it up. I told him I'd load up some more.
Point being, sometimes just because the barrel's pitted doesn't necessarily mean that the barrel is ready to be trashed. Try a good scrub on it, and maybe some JB's bore compound (which was going to be my next step if it didn't shoot) and see if it shoots.
But maintenance is the key. Don't let them get to this condition to start off with.
just my .02 worth.
I'm liking this site more and more.