Long Answer: At the beginning of the declare attackers step inside the combat phase the attacking player selects which, if any, creatures he or she controls will attack and the player or planeswalker each will attack.
So for combat your intention is made clear right from the start, this does differ to dealing damage to a planeswalker through spells such as Lightning Bolt - That damage is only redirected to a planeswalker on resolution of the spell (though you can't fake out your opponent by saying one thing and then changing your mind).
The relevant rules are basically 508.1 and 508.1a through 508.1j. Below are the parts relevant to this exact question, most of it has been cut out.
508.1. First, the active player declares attackers. This turn-based action doesn‘t use the stack. [snip]
508.1a The active player chooses which creatures that he or she controls, if any, will attack. [snip]
508.1b If the defending player controls any planeswalkers, or the game allows the active player to attack multiple other players, the active player announces which player or planeswalker each of the chosen creatures is attacking.
If anyone is interested in having a look at the behemoth that is the Comprehensive Rules, it is freely available on the Wizards site
Link fixed now
There are other, more user friendly, documents there as well.