[COMMITTED] BZ #16529: Fix pedantic warning with netinet/in.h.
Ondřej Bílka
neleai@seznam.cz
Thu Feb 6 16:19:00 GMT 2014
On Thu, Feb 06, 2014 at 11:17:40AM -0500, Carlos O'Donell wrote:
> Fix pedantic warning with netinet/in.h.
>
> commit 86104132164449badace8d722c8a3bc56b588f1c
> Author: Carlos O'Donell <carlos@redhat.com>
> Date: Thu Feb 6 11:12:48 2014 -0500
>
> BZ #16529: Fix pedantic warning with netinet/in.h.
>
> When compiling with pedantic the following warning is seen:
>
> gcc -Wall -pedantic -O0 -o test test.c
> In file included from test.c:3:0:
> /path/inet/netinet/in.h:111:21: warning: comma at end of \
> enumerator list [-Wpedantic]
> IPPROTO_MH = 135, /* IPv6 mobility header. */
> ^
>
> It is valid C99 to have a trailing comma after the last item in
> an enumeration. However it is not valid C90. If possible glibc
> attempts to keep all headers C90 + long long without requiring
> C99 features. In this case it's easy to fix the headers and it
> removes the warning seem with -pedantic.
>
> diff --git a/ChangeLog b/ChangeLog
> index 9aa314e..88ebfb1 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,8 @@
> +2014-02-06 Carlos O'Donell <carlos@redhat.com>
> +
> + [BZ #16529]
> + * inet/netinet/in.h: Remove comma after IPPROTO_MH.
> +
> 2014-02-05 Carlos O'Donell <carlos@rehdat.com>
>
> * sysdeps/unix/sysv/linux/kernel-features.h: Fix comment.
> diff --git a/NEWS b/NEWS
> index c0d981e..913ab90 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -26,7 +26,7 @@ Version 2.19
> 16271, 16274, 16283, 16289, 16293, 16314, 16316, 16330, 16337, 16338,
> 16356, 16365, 16366, 16369, 16372, 16375, 16379, 16384, 16385, 16386,
> 16387, 16390, 16394, 16398, 16400, 16407, 16408, 16414, 16430, 16431,
> - 16453, 16474, 16506, 16510
> + 16453, 16474, 16506, 16510, 16529
>
> * Slovenian translations for glibc messages have been contributed by the
> Translation Project's Slovenian team of translators.
> diff --git a/inet/netinet/in.h b/inet/netinet/in.h
> index ad9ce6c..d8d8e53 100644
> --- a/inet/netinet/in.h
> +++ b/inet/netinet/in.h
> @@ -108,7 +108,7 @@ enum
> #define IPPROTO_NONE IPPROTO_NONE
> IPPROTO_DSTOPTS = 60, /* IPv6 destination options. */
> #define IPPROTO_DSTOPTS IPPROTO_DSTOPTS
> - IPPROTO_MH = 135, /* IPv6 mobility header. */
> + IPPROTO_MH = 135 /* IPv6 mobility header. */
> #define IPPROTO_MH IPPROTO_MH
> };
> #endif /* !__USE_KERNEL_IPV6_DEFS */
> ---
>
> Cheers,
> Carlos.
looks ok.
More information about the Libc-alpha
mailing list