From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28222 invoked by alias); 8 Sep 2002 01:56:41 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 28208 invoked from network); 8 Sep 2002 01:56:39 -0000 Received: from unknown (HELO mailhost.intrinsity.com) (208.246.32.130) by sources.redhat.com with SMTP; 8 Sep 2002 01:56:39 -0000 Received: from victoria.eng.evsx.com (victoria.eng.evsx.com [192.168.1.29]) by mailhost.intrinsity.com (Postfix) with ESMTP id 09E853F40D for ; Sat, 7 Sep 2002 20:56:38 -0500 (CDT) Received: from beeville.vert.intrinsity.com (beeville.vert.intrinsity.com [192.168.3.48]) by victoria.eng.evsx.com (8.10.1/8.10.1) with ESMTP id g881uc003080; Sat, 7 Sep 2002 20:56:38 -0500 (CDT) From: Fred Fish Received: (from fnf@localhost) by beeville.vert.intrinsity.com (8.11.2/8.11.4) id g881u5w10758; Sat, 7 Sep 2002 20:56:05 -0500 Message-Id: <200209080156.g881u5w10758@beeville.vert.intrinsity.com> Subject: [RFA] Fix gdb.gdbtk/simple.c strncpy args To: gdb-patches@sources.redhat.com Date: Sat, 07 Sep 2002 18:56:00 -0000 Cc: fnf@intrinsity.com Reply-To: fnf@intrinsity.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00110.txt.bz2 Strncpy is supposed to take pointers... simple.c: In function `main': simple.c:15: warning: passing arg 1 of `strncpy' makes pointer from integer without a cast simple.c:15: warning: passing arg 2 of `strncpy' makes pointer from integer without a cast WARNING: Testcase compile failed, so some tests in this file will automatically fail. 2002-09-07 Fred Fish * simple.c: Pass addresses to strncpy, not chars. Index: simple.c =================================================================== RCS file: /mips/newtools/fsf/gdb/gdb/testsuite/gdb.gdbtk/simple.c,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 simple.c *** simple.c 2002/07/04 20:33:37 1.1.1.1 --- simple.c 2002/09/08 01:23:50 *************** main(int argc, char * argv[]) *** 12,18 **** { int j = i % 3; int k = 3 - j; ! strncpy (a[i], b[k], j); foo = (long) j * k / i + 2 * k * k * k; } return 0; --- 12,18 ---- { int j = i % 3; int k = 3 - j; ! strncpy (&a[i], &b[k], j); foo = (long) j * k / i + 2 * k * k * k; } return 0;