This took ages to work out. If I submit the following query
The resulting workunit does not contain any warnings even though they are reported. If I use
then they are correctly retained.
Richard pointed out there is a call to clearExceptions() in CWsEclBinding::submitWsEclWorkunit which is possibly the cause.