I would be nervous about a 24x40 building with 2x4 walls, that seems like a lot of roof to be held up by that amount of wood. I built a 20x30 building for the sawmill and tractor storage and used actual 2x6 rough cut and wouldn't have wanted to have much less. I also agree about full length studs being stronger, no doubt.