We study the necking of a filament of complex fluid or soft solid subject to uniaxial tensile stretching, separately under conditions of constant imposed tensile stress and constant imposed tensile force, by means of linear stability analysis and nonlinear simulations at the level of a slender filament approximation. We demonstrate necking to be a flow instability that arises as an unavoidable consequence of the viscoelastic constitutive behaviour of essentially any material (with a possible rare exception). We derive criteria for the onset of necking that can be reported in terms of characteristic signatures in the shapes of the experimentally measured material functions, and that should therefore apply universally to all viscoelastic materials. To confirm their generality, we show them to hold numerically in six constitutive models: the Oldroyd B, Giesekus, non-stretch Rolie-Poly, finite-stretch Rolie-Poly and Pom-pom models, and a simplified toy model of coil-stretch hysteresis, which has a non-monotonic underlying extensional constitutive curve. Under conditions of constant imposed tensile stress, we find two distinct dynamical regimes as a function of the time since the inception of the flow. In the first regime the strain rate quickly attains a value prescribed by the fluid's underlying stationary homogeneous extensional constitutive curve, at the given imposed stress. During this first regime, no appreciable (or only minimal) necking arises. A second regime then ensues in which the initially homogeneous flow destabilises to form a neck. This necking instability can occur via two distinct possible modes. The first mode is relatively gentle and arises in any regime where the slope of the extensional constitutive curve is positive. It has a rate of necking per accumulated strain unit set by the inverse of the slope of the constitutive curve on a log-log plot. The second mode sets in when a carefully defined 'elastic derivative' of the tensile force first slopes down as a function of the time since the inception of the flow. We discuss the way in which these modes of instability manifest themselves in entangled polymeric fluids, demonstrating four distinct regimes of necking behaviour as a function of imposed stress. Under conditions of constant imposed tensile force, typically the flow sweeps up the underlying constitutive curve of the fluid in question, again with instability to necking in any regime where that curve is positively sloping. arXiv:1606.07705v2 [cond-mat.soft]