From patchwork Tue Dec 2 21:46:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 417153 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9E2DB140185 for ; Wed, 3 Dec 2014 08:47:00 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version:content-type; q=dns; s=default; b=A6w72 S5Pt62yX/Q9EwYmlWRSu+jAV2kCEH4l8UBm1ehPraacs1kVxBU2NeXGljWl4mRu0 1W3DWOQFscoE2wLCvRe/iNFA3KUeHzv+BlQy/bRqfWzFUjqq1X1VJrWXN7lCMDiO RUIPSKLZ9gTFxfZb7LAl6Ji52WVAw2GArnFiL4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version:content-type; s=default; bh=JcnriPnEhfY kXgFYuwO7DDneHOY=; b=DSu7rcenvsAItWrPQMllip0ViClkKfDyoc4kbogH0MV yOcZgkIn2gD309v6XUoMJUHR6T1pE7+mR6P6g5ymFzk4cUt/brQGxTCCtR/65FO5 0iZoMfPEyh24cFTGRupzXTRN0/GMnRN5g4CwC/scUw9T2TIcX7dgX5CDQHQ883AI = Received: (qmail 6100 invoked by alias); 2 Dec 2014 21:46:54 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 6086 invoked by uid 89); 2 Dec 2014 21:46:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Tue, 2 Dec 2014 21:46:46 +0000 From: Joseph Myers To: Roland McGrath CC: Subject: Re: Fix warning in posix/tst-getopt_long1.c In-Reply-To: <20141202192109.1E0A42C39FE@topped-with-meat.com> Message-ID: References: <20141202192109.1E0A42C39FE@topped-with-meat.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 On Tue, 2 Dec 2014, Roland McGrath wrote: > The strings won't be modified. So why not just add (char *) casts? Here is a patch version using casts. Tested for x86_64. 2014-12-02 Joseph Myers * posix/tst-getopt_long1.c (do_test): Cast elements of argv array to char *. diff --git a/posix/tst-getopt_long1.c b/posix/tst-getopt_long1.c index e0ecd12..3895ebd 100644 --- a/posix/tst-getopt_long1.c +++ b/posix/tst-getopt_long1.c @@ -39,7 +39,7 @@ do_test (void) return 1; } - char *argv[] = { "program", "--on" }; + char *argv[] = { (char *) "program", (char *) "--on" }; int argc = 2; int c = getopt_long (argc, argv, "12345", opts, NULL);