From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1523D138332 for ; Mon, 9 Apr 2018 07:15:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 14480E0CB6; Mon, 9 Apr 2018 07:15:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E9641E0CB6 for ; Mon, 9 Apr 2018 07:15:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AFE09335C5C for ; Mon, 9 Apr 2018 07:15:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7AEC2266 for ; Mon, 9 Apr 2018 07:15:40 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1522947776.6d6a52d90e5a16f86947fd163aac23d3b7b66f32.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/xstrdup.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 6d6a52d90e5a16f86947fd163aac23d3b7b66f32 X-VCS-Branch: master Date: Mon, 9 Apr 2018 07:15:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d02a4c80-ac74-4a49-8956-3f42d5a162e2 X-Archives-Hash: 172107ddf4e54b1a73971523f3e3763b commit: 6d6a52d90e5a16f86947fd163aac23d3b7b66f32 Author: Fabian Groffen gentoo org> AuthorDate: Thu Apr 5 17:02:56 2018 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Thu Apr 5 17:02:56 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=6d6a52d9 xstrdup: avoid warning about clobbering t When using optimisation, the compiler does something to a char pointer it doesn't do to a void pointer, so use a couple of casts to avoid a clobber warning. libq/xstrdup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libq/xstrdup.c b/libq/xstrdup.c index 6924d21..e069c9d 100644 --- a/libq/xstrdup.c +++ b/libq/xstrdup.c @@ -29,16 +29,16 @@ static char *xstrdup(const char *s) { - char *t; + void *t; if (s == NULL) return NULL; - t = strdup(s); + t = (void *)strdup(s); if (unlikely(t == NULL)) err("Out of memory"); - return t; + return (char *)t; } static char *xstrdup_len(const char *s, size_t *len)