A globally conservative Galerkin/least-squares formulation which attains correct shock structure is developed for any choice of variables. Only the choice of entropy variables satisfies exactly the discrete Clausius-Duhem inequality without any dissipative mechanisms, whereas for the rest of the variables, artificial diffusion is required to guarantee entropy production. The limit of the formulation is well defined for entropy variables and the primitive variables (p, u, T), leading to conservative incompressible formulations. The approach is stable for any continuous interpolations, both for compressible and incompressible flows. A comparative study of different variables is performed, indicating that entropy variables and the primitive variables (p, u, T) possess the most attributes for practical problem solving.