I was leafing through the "Encyclopedia of Taboos" and found an interesting article about whistling.
Now, it seems that you can whistle in the dark or become a whistle-blower, not to mention the wolf-whistle that some men use to show the animal within, but still, it is useful to know that in the Islam world, whistling is forbidden because of its association with sorcery and the casting of spells in pre-Islamic times. Whistling is also a means of “communication with the Jinn”. The Jinn (from which the English word “genie” derives) inhabit the immaterial world. In the Koran it is stated that the jinn were created from “smokeless fire” while man was made of clay and angels were formed from light.
Moreover, the French anthropologist, Claude Lévi-Strauss, has uncovered a link between whistling and sorcery in ancient tribes, fact described in his book "From Honey to Ashes: Introduction to a Science of Mythology".
If you also happen to travel at sea, mind that you could easily be thrown overboard if you attempt to communicate with the jinn, simply because whistling at sea is deemed unlucky.