https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119011
--- Comment #25 from Alejandro Colomar <[email protected]> --- (In reply to Paul Eggert from comment #24) > (In reply to Alejandro Colomar from comment #21) > > Jonathan's suggestion was to treat -1 as a special case, diagnosing all > > others. I think that makes sense, as -1 is a well-known error code, while > > -2 sounds like an actual -2, and probably should be diagnosed. > > But functions like mbrtowc return error codes like -2 and -3, converted to > size_t. It is also a pain to pacify -Wsign-compare for calls to these > functions. Hmmm. I think the design of mbrtowc(3) could be improved. It could have set errno to something different (maybe EINPROGRESS instead of returning -2?). Now that we have it, I guess the only thing we can do is adapt to it. So, we must accept arbitrary unsuffixed literals.
