  We investigate the symmetry of the superconducting order parameter in the
proximity of a phase-separation or of an incommensurate charge-density-wave
instability. The attractive effective interaction at small or intermediate
transferred momenta is singular near the instability. This strongly
$q$-dependent interaction, together with a residual local repulsion between the
quasiparticles and an enhanced density of states for band structures
appropriate for the high temperature superconducting oxides, strongly favors
the formation of $d$-wave superconductivity. The relative stability with
respect to superconductivity in the $s$-wave channel is discussed in detail,
finding this latter hardly realized in the above conditions. The
superconducting temperature is mostly determined by the closeness to the
quantum critical point associated to the charge instability and displays a
stronger dependence on doping with respect to the simple proximity to a Van
Hove singularity. The relevance of this scenario and the generic agreement of
the resulting phase diagram with the properties displayed by high temperature
superconducting oxides is discussed.
