http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47296
--- Comment #8 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-15 19:31:17 UTC --- I suppose one thing that could be done is to set opp->file and opp->file_len regardless of whether mkstemp() succeeds or not, that is lines 1987:1093 in unix.c, and then in open.c:new_unit() one can free opp->file after generating a suitable error message. Even if the file name is automatically generated, maybe it would be helpful to provide the user with info exactly what failed, e.g. so that the user knows what failed was opening a file under /tmp which might otherwise not be obvious to the user.