They use their cannons for peaceful purposes. They do what they can to aid Mario (and Yoshi, Luigi, and Wario on the DS version), because they too are against Bowser. Maybe they once used their cannons against the black bob-ombs, but stopped when they realized that violence wasn't the answer.