  The 21-cm spectral line widths, $w_{50}$, of galaxies are an approximate
tracer of their dynamical masses, such that the dark matter halo mass function
is imprinted in the number density of galaxies as a function of $w_{50}$.
Correcting observed number counts for survey incompleteness at the level of
accuracy needed to place competitive constraints on warm dark matter (WDM)
cosmological models is very challenging, but forward-modelling the results of
cosmological hydrodynamical galaxy formation simulations into observational
data space is more straightforward. We take this approach to make predictions
for an ALFALFA-like survey from simulations using the EAGLE galaxy formation
model in both cold (CDM) and WDM cosmogonies. We find that for WDM cosmogonies
more galaxies are detected at the low-$w_{50}$ end of the 21-cm velocity width
function than in the CDM cosmogony, contrary to what might na\"ively be
expected from the suppression of power on small scales in such models. This is
because low-mass galaxies form later and retain more gas in WDM cosmogonies
(with EAGLE). While some shortcomings in the treatment of cold gas in the EAGLE
model preclude placing definitive constraints on WDM scenarios, our analysis
illustrates that near-future simulations with more accurate modelling of cold
gas will likely make strong constraints possible, especially in conjunction
with new 21-cm surveys such as WALLABY.
