Just to add to hopkirk's bit, section on naval jacks from Wikipedia:
//Jacks are additional national flags flown by warships (and certain other vessels) at the head of the ship. These are usually flown while not under way and when the ship is dressed on special occasions. Jacks in the Royal Navy must be run up when the first line is ashore when coming alongside.
In Britain's Royal Navy, the Union Flag at sea serves both as a naval jack and as the rank flag of an Admiral of the Fleet. It is illegal for a merchant ship or yacht to fly the Union Flag, but permissible to fly a civilian jack (sometimes known as the pilot jack as it was formerly used to request a pilot) that consists of the Union Flag with a white border. The St George's Cross flown from the jackstaff is known as the Dunkirk jack, and is customarily flown by ships and boats which took part in the Dunkirk evacuation operation in 1940. The flying of the St George's Cross elsewhere on a civilian ship is illegal, as it is the rank flag of a full Admiral.//
And it's back to pedants' corner for me...