From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73480 invoked by alias); 2 Oct 2018 15:55:49 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 73456 invoked by uid 89); 2 Oct 2018 15:55:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*c:alternative, our, H*Ad:U*jb X-HELO: mail-yb1-f175.google.com Received: from mail-yb1-f175.google.com (HELO mail-yb1-f175.google.com) (209.85.219.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Oct 2018 15:55:47 +0000 Received: by mail-yb1-f175.google.com with SMTP id e190-v6so983141ybb.5; Tue, 02 Oct 2018 08:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P1Urzq6hnyNROESjRDVFxwLKxqrfQXlkq5VO3tbB5vA=; b=lTRrB4bU4Z7o7UCv+VcUCViupz3OPExaiL3i+wJ0XaAqbe4HOF1PbwAQaf2Y89C2e4 QXd8fIVYe2RyDC4duZtjDtN1sZ7b3GECaiSz0zFRN58dAvd9FgbbZDO54Ba3BczrjZ3y Mb8AVGOFrtLPylikvTvz3Ubgfdr8W5KlIoPKB2NQIxbRbGI/nsZ/0VuMZrBjmAI96Ez/ nW2qopumzbBP3mO4+mYFaOSd6ameXW36NTt4Xmr8tjNVXwuDoMijm0ADf4C9SZvgANxJ HX3PNE8xYJt4juBuJU9V/vLLwAWBwecd9L4FPnefjlJl1O4dCo1geOyQMGKKiewf89i/ mKZg== MIME-Version: 1.0 References: In-Reply-To: From: Janne Blomqvist Date: Tue, 02 Oct 2018 15:55:00 -0000 Message-ID: Subject: Re: [PATCH,Fortran] Fix libgfortran/io/close.c for !HAVE_UNLINK_OPEN_FILE To: Gerald Pfeifer Cc: Fortran List , GCC Patches , Janne Blomqvist Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00007.txt.bz2 On Tue, Oct 2, 2018 at 2:08 PM Gerald Pfeifer wrote: > Revision r215307 | jb | 2014-09-16 23:40:28 +0200 (Di, 16 Sep 2014) > > PR libfortran/62768 Handle filenames with embedded null characters. > : > > made the changes like the following to libgfortran/io/close.c > > #if !HAVE_UNLINK_OPEN_FILE > - path =3D fc_strdup (u->file, u->file_len); > + path =3D strdup (u->filename); > #endif > > > One of our users now reported this build failure for a system where > (for whatever reason) HAVE_UNLINK_OPEN_FILE is not defined: > > .../GCC-HEAD/libgfortran/io/close.c:94:11: error: implicit declaration > of function =E2=80=98strdup=E2=80=99 > 94 | path =3D strdup (u->filename); > | ^~~~~~ > > > By #undef-ining HAVE_UNLINK_OPEN_FILE beetween the #include "..." and > #include <...> statements in libgfortran/io/close.c I could reproduce > this on FreeBSD 11/i386. > > And I could validate the fix below, both with and without that #undef > in place. > > > Tested on i386-unknown-freebsd11.1. > > > Okay to commit? > > I'd also like to apply this to older release branches (down to GCC 6) > since it is obviously broken and the fix appears straightforward. If > approved, I'm thinking to wait about a week or two before making each > step backwards (from HEAD to 8, 8 to 7, and 7 to 6). > > Gerald > Ok, thanks! --=20 Janne Blomqvist