All of lore.kernel.org
 help / color / mirror / Atom feed
From: Micha Feigin <michf@post.tau.ac.il>
To: linux-c-programming@vger.kernel.org
Subject: Re: dereferencing pointer to incomplete type
Date: Thu, 17 Jun 2004 07:21:13 +0300	[thread overview]
Message-ID: <20040617042113.GE16146@luna.mooo.com> (raw)
In-Reply-To: <00d301c453f5$f15ec7b0$d3113b80@yoursgz3xpngo4>

On Wed, Jun 16, 2004 at 07:02:04PM -0400, Anshuman S. Rawat wrote:
> > > Arping.xs:153: dereferencing pointer to incomplete type
> > >  make: *** [Arping.o] Error 1
> > >
> > >  Now line 153 in the source is - 
> > >  
> > >  memcpy(enet_src, src_mac->ether_addr_octet,6);
> > >  where
> > >  u_char enet_src[6] = {0x00, 0x00, 0x00, 0x00, 0x00,0x00};
> > >  struct ether_addr *src_mac;
> > >  struct ether_addr
> > >  {
> > >      u_char  ether_addr_octet[6];
> > >  };
> > 
> > Try as a test to add the struct definition just before the call to
> > memcpy and see if that resolves the error. Could be that for some
> > reason things aren't included properly.
> 
> I already tried this. It didn't help.
> 

In this case its probably something else.

Are you sure that u_char is properly defined? what happens if you add
before the these definitions?

typedef unsigned char * u_char;

or write:

memcpy((void *)enet_src, (void *)(src_mac->ether_addr_octet), 6);

or just to make sure we are looking at the right thing to do

memcpy(enet_src, enet_src, 6);

BTW, what is the .xs file sufix?

> -Anshuman 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>  
>  +++++++++++++++++++++++++++++++++++++++++++
>  This Mail Was Scanned By Mail-seCure System
>  at the Tel-Aviv University CC.
> 

  reply	other threads:[~2004-06-17  4:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-16 19:56 dereferencing pointer to incomplete type Anshuman S. Rawat
2004-06-16 20:14 ` Christoph Bussenius
2004-06-16 20:13   ` Anshuman S. Rawat
2004-06-16 21:04     ` Glynn Clements
2004-06-16 22:01 ` Micha Feigin
2004-06-16 23:02   ` Anshuman S. Rawat
2004-06-17  4:21     ` Micha Feigin [this message]
2004-06-17  8:46       ` Christoph Bussenius
2004-06-17 10:24       ` Glynn Clements
2004-06-17 17:03         ` Micha Feigin
  -- strict thread matches above, loose matches on Subject: below --
2004-06-16 18:29 Anshuman Singh Rawat
2004-06-16 19:07 ` Flemming Greve Skovengaard

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=20040617042113.GE16146@luna.mooo.com \
    --to=michf@post.tau.ac.il \
    --cc=linux-c-programming@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.