From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3115 invoked by alias); 23 Mar 2018 01:30:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 2909 invoked by uid 89); 23 Mar 2018 01:30:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=werror, Werror X-HELO: mail-pg0-f66.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=j8+jxSw7smUB0W/tuFSnV+u2AKz+2l+QDizVrGe2aaI=; b=q7o2Yo8QfeIv2q8djV0IwDO50akNrsJj0MTGN2P+9l5LybR6NCfbqtAZQEoeYNbV6+ I8vHWt3tBi/xpmWJhuUGLpJiN5PZJ5t8jkLOJZvnnfLXUTscmpWFTvQDXI8WuZidMpIj zuTKRCwMfCxfwJEn7jqTWO3qRQv4xfnaE6zqk4d/+AjfjiJcO7gjEyKuHf7AGO5c4Gv9 e1UZuo2ZDBIGBd4B2SORUDectq2SBwPDhZFnyFVFNB8sH+sGyNPI60ejAWcw4BcIMrlQ e6oqkDG6Qi6i50C17UHc1m3HWhdJD4zpIwfDs55gAcuSHm8EgdjO0xXVqZGrt6C4TxH9 fCPw== X-Gm-Message-State: AElRT7EAjBAY6POVr8bzl4Qc7aEvgQl2LH1FYpc3EmyMBK88Wcs27DFC lEc0Idztgf+F7AsLVR2fK053iuXp3SyejMmjdJ8= X-Google-Smtp-Source: AG47ELuZlGy+7R1CrvVCsYwAWlTtEScYKxV8qPQyT/pCwj9w3ggpykLFkcgjvqmIfDDDsWqWmYmlQ+WIk7yYh47nLio= X-Received: by 10.98.155.137 with SMTP id e9mr12721749pfk.109.1521768624483; Thu, 22 Mar 2018 18:30:24 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20180323010729.41457-1-raj.khem@gmail.com> From: Khem Raj Date: Fri, 23 Mar 2018 01:30:00 -0000 Message-ID: Subject: Re: [PATCH] Replace strncpy with memccpy to fix -Wstringop-truncation. To: Joseph Myers Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-03/txt/msg00533.txt.bz2 Hi Joseph On Thu, Mar 22, 2018 at 6:17 PM, Joseph Myers wrote: > On Thu, 22 Mar 2018, Khem Raj wrote: > >> * nis/nss_nisplus/nisplus-parser.c: Replace strncpy with memcpy to >> avoid -Wstringop-truncation. > > Could you give more details of (a) in what circumstances (architecture, > compiler, etc.) you get this warning and (b) why the truncation is > correct? > > Whatever build failure you got hasn't shown up with build-many-glibcs.py. > Maybe that should include a configuration with --enable-obsolete-rpc > --enable-obsolete-nsl to make sure that it tests building those bits of > code that are disabled by default? > This is seen with gcc/trunk when cross compiling for armv7ve target and yes --enable-obsolete-rpc is used to configure, I am using OpenEmbedded build system. nss_nisplus/nisplus-parser.c:90:7: error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation] strncpy (first_unused, numstr, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nss_nisplus/nisplus-parser.c:106:7: error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation] strncpy (first_unused, numstr, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~