In this paper, the exact discrete adjoint of an unstructured finite-volume formulation of the Euler equations in two dimensions is derived and implemented. The adjoint equations are solved with the same implicit scheme as used for the flow equations. The scheme is modified to efficiently account for multiple functionals simultaneously. An optimization framework, which couples an analytical shape parameterization to the flow/adjoint solver and to algorithms for constrained optimization, is tested on airfoil design cases involving transonic as well as supersonic flows. The effect of some approximations in the discrete adjoint, which aim at reducing the complexity of the implementation, is shown in terms of optimization results rather than only in terms of gradient accuracy. The shape-optimization method appears to be very efficient and robust.