Let K be an arbitrary compact space and C(K) the space of continuous functions on K endowed with its natural supremum norm. We show that for any subset B of the unit sphere of C(K)* on which every function of C(K) attains its norm, a bounded subset A of C(K) is weakly compact if, and only if, it is compact for the topology tp(B) of pointwise convergence on B. It is also shown that this result can be extended to a large class of Banach spaces, which contains, for instance, all uniform algebras. Moreover we prove that the space (C(K), tp(B)) is an angelic space in the sense of D. H. Fremlin.