From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13118 invoked by alias); 8 Dec 2014 12:48:53 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13076 invoked by uid 48); 8 Dec 2014 12:48:49 -0000 From: "jg at jguk dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug driver/64094] "No such file or directory" -> "No such file" Date: Mon, 08 Dec 2014 12:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: driver X-Bugzilla-Version: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jg at jguk dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg00724.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64094 --- Comment #5 from Jon Grant --- Hi Manu I like your open_strerror() propopsal. Is this how Bintuils has done it? Note: I realise this problem stems from ENOENT being used by both opendir() and open(). I think you only need to provide two wrappers to handle these cases Note: %m is not ideal in my view as it is a C Library extension that I believe is not widely supported. could it be replaced with %s? http://www.gnu.org/software/libc/manual/html_node/Other-Output-Conversions.html Alternatively, could have a check where files are stat() before they are opened, and then report the error then. Likewise for directories.