Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Fred Fish <fnf@intrinsity.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Fix gdb.gdbtk/simple.c strncpy args
Date: Mon, 09 Sep 2002 08:39:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.44.0209090840530.1395-100000@valrhona.uglyboxes.com> (raw)
In-Reply-To: <200209080156.g881u5w10758@beeville.vert.intrinsity.com>

On Sat, 7 Sep 2002, Fred Fish wrote:

> 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.

Wow, I thought I'd fixed this a long time ago... Hmmm. Oh, well. I guess 
not!

Of course this is approved! [BTW, insight also follows gdb's standard 
"obvious fix" rules, too.]

Thanks!
Keith

> 2002-09-07  Fred Fish  <fnf@intrinsity.com>
> 
> 	* 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;
> 


      reply	other threads:[~2002-09-09 15:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-07 18:56 Fred Fish
2002-09-09  8:39 ` Keith Seitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0209090840530.1395-100000@valrhona.uglyboxes.com \
    --to=keiths@redhat.com \
    --cc=fnf@intrinsity.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox