This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 10/13] Installed-header hygiene (BZ#20366): struct ether_addr.
- From: Carlos O'Donell <carlos at redhat dot com>
- To: Zack Weinberg <zackw at panix dot com>, libc-alpha at sourceware dot org
- Cc: joseph at codesourcery dot com
- Date: Wed, 21 Sep 2016 15:26:05 -0400
- Subject: Re: [PATCH 10/13] Installed-header hygiene (BZ#20366): struct ether_addr.
- Authentication-results: sourceware.org; auth=none
- References: <20160830011645.25769-1-zackw@panix.com> <20160830011645.25769-2-zackw@panix.com> <20160830011645.25769-3-zackw@panix.com> <20160830011645.25769-4-zackw@panix.com> <20160830011645.25769-5-zackw@panix.com> <20160830011645.25769-6-zackw@panix.com> <20160830011645.25769-7-zackw@panix.com> <20160830011645.25769-8-zackw@panix.com> <20160830011645.25769-9-zackw@panix.com> <20160830011645.25769-10-zackw@panix.com> <20160830011645.25769-11-zackw@panix.com>
On 08/29/2016 09:16 PM, Zack Weinberg wrote:
> Some versions of netinet/if_ether.h only define struct ether_addr when
> __USE_MISC. This breaks function prototypes in netinet/ether.h that
> depend on it. The path of least resistance is to condition those
> declarations on __USE_MISC too.
>
> * inet/netinet/if_ether.h: Condition all function prototypes
> on __USE_MISC, to ensure struct ether_addr is declared.
You need to explain this in more detail please.
A quick review shows struct ether_addr is not guarded by __USE_MISC
e.g.
sysdeps/generic/netinet/if_ether.h
sysdeps/unix/sysv/linux/net/ethernet.h
Under exactly what conditions is this cleaning up the headers?
> ---
> inet/netinet/ether.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/inet/netinet/ether.h b/inet/netinet/ether.h
> index 3dff523..0952b23 100644
> --- a/inet/netinet/ether.h
> +++ b/inet/netinet/ether.h
> @@ -24,6 +24,7 @@
> /* Get definition of `struct ether_addr'. */
> #include <netinet/if_ether.h>
>
> +#ifdef __USE_MISC
> __BEGIN_DECLS
>
> /* Convert 48 bit Ethernet ADDRess to ASCII. */
> @@ -49,5 +50,6 @@ extern int ether_line (const char *__line, struct ether_addr *__addr,
> char *__hostname) __THROW;
>
> __END_DECLS
> +#endif /* Use misc. */
>
> #endif /* netinet/ether.h */
>
--
Cheers,
Carlos.