From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23163 invoked by alias); 7 Jun 2014 19:13:51 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32740 Received: (qmail 10722 invoked from network); 7 Jun 2014 19:13:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=++4USboCsZWVoJasdXcaEISf9cKurjdx5Djw8lqCYNE=; b=Mrr/Wvi+QZkd30NDsEpNIzvYFs+xifgUNUww4s6c7LEzJUE9NVlbu3Uq+rpKGQvV0R OCy5WSbH200WGptSIbwlP0y7aLQyjcmQpA4tFepz3qOJtGgd9V28TH+NBebuwryNnb0z OrgH70/xi7MB8b7kgETITj0Ko4wA0VojXM6jdPxNKAMgeNsyh3TE3dDUlBavBEU5jGEq ih+hy7+9rp5ssu8QoGz9JDHXyrd40QsIstVTI0sfILXxtGoE+lvfG9A3vTJPhxeMDNOy 22u1VqkAW9m48ESBotR/FdhougGMdKxLXQDyiYyd/Z+rDKB6JfRWoxaZ1Kd6q12H8D31 cyYA== X-Received: by 10.15.68.134 with SMTP id w6mr51719eex.3.1402168413325; Sat, 07 Jun 2014 12:13:33 -0700 (PDT) Sender: Nikolas Garofil Message-ID: <5393645B.7050409@garofil.be> Date: Sat, 07 Jun 2014 21:13:31 +0200 From: Nikolas Garofil User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: zsh-workers@zsh.org Subject: Re: [PATCH 1/6] fix implicit typecast for strict compilers References: <1402161535-20756-1-git-send-email-nikolas@garofil.be> <140607120439.ZM24985@torch.brasslantern.com> In-Reply-To: <140607120439.ZM24985@torch.brasslantern.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 06/07/2014 09:04 PM, Bart Schaefer wrote: > On Jun 7, 7:18pm, Nikolas Garofil wrote: > } > } diff --git a/Src/compat.c b/Src/compat.c > } index cc4e876..81a95d5 100644 > } --- a/Src/compat.c > } +++ b/Src/compat.c > } @@ -40,7 +40,7 @@ strstr(const char *s, const char *t) > } char *p1, *p2; > } > } for (; *s; s++) { > } - for (p1 = s, p2 = t; *p2; p1++, p2++) > } + for (p1 = (char*)s, p2 = (char*)t; *p2; p1++, p2++) > } if (*p1 != *p2) > } break; > } if (!*p2) > } -- > > > Wouldn't the right thing here be to declare > > const char *p1, *p2; > > instead of casting? > The p1 and p2 pointers are increased at the end of the line to walk through the string so that wouldn't work