Quantcast

incomplete type

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

incomplete type

Hassan Elmadi
Hi all,

I'm trying to generate a struct ieee80211vap by calling malloc() and get compile errors (I'm using gcc) like:

 /usr/include/linux/if.h:165: error: field 'ifru_addr' has incomplete type

ifru_addr is of type struct sockaddr, which is defined in socket.h.

I believe these compile errors are due to struct sockaddr being defined under this macro:

#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

Am I right and how can I fix this?

Thanks.

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today.  Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Madwifi-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/madwifi-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: incomplete type

Pavel Roskin
On 05/02/2011 09:07 PM, Hassan Elmadi wrote:
> Hi all,
>
> I'm trying to generate a *struct ieee80211vap* by calling *malloc*() and get
> compile errors (I'm using gcc) like:

Please post messages in plain text without HTML.  Not only does it save
the bandwidth, but it also makes your message unambiguous, since what
you write is what others see.

After checking the HTML portion of your e-mail I found that you actually
tried to use malloc().  "*malloc*" could mean that you tried various
functions with "malloc" in it, such as kmalloc().

libc functions are not available in the kernel code.  Please use the
calls available in the kernel.  kmalloc() is the kernel equivalent of
malloc().

> I believe these compile errors are due to *struct sockaddr* being defined
> under this macro:
>
> #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__<  2)

I don't think anything needs fixing.

--
Regards,
Pavel Roskin

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today.  Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Madwifi-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/madwifi-users
Loading...