[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#844491: linux-atm: FTBFS: time.h:9:8: error: redefinition of 'struct timespec'



Control: reassign -1 linux-libc-dev 4.8.5-1
Control: retitle -1 linux/atm_zatm.h change breaks time.h inclusion
Control: tags -1 fixed-upstream patch

On Wed, Nov 16, 2016 at 09:46:03AM +0000, Chris Lamb wrote:
>...
>   In file included from /usr/include/linux/atm_zatm.h:17:0,
>                    from zntune.c:17:
>   /usr/include/linux/time.h:9:8: error: redefinition of 'struct timespec'
>    struct timespec {
>           ^~~~~~~~
>   In file included from /usr/include/x86_64-linux-gnu/sys/select.h:45:0,
>                    from /usr/include/x86_64-linux-gnu/sys/types.h:219,
>                    from /usr/include/stdlib.h:275,
>                    from zntune.c:9:
>   /usr/include/time.h:120:8: note: originally defined here
>    struct timespec
>...

Thanks for your report, this is a bug in the kernel userspace headers.

I've attached the fix that was applied upstream.

> Regards,

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

commit 7b5b74efcca00f15c2aec1dc7175bfe34b6ec643
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Thu Nov 10 19:08:39 2016 -0500

    Revert "include/uapi/linux/atm_zatm.h: include linux/time.h"
    
    This reverts commit cf00713a655d ("include/uapi/linux/atm_zatm.h: include
    linux/time.h").
    
    This attempted to fix userspace breakage that no longer existed when
    the patch was merged.  Almost one year earlier, commit 70ba07b675b5
    ("atm: remove 'struct zatm_t_hist'") deleted the struct in question.
    
    After this patch was merged, we now have to deal with people being
    unable to include this header in conjunction with standard C library
    headers like stdlib.h (which linux-atm does).  Example breakage:
    x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I./../q2931 -I./../saal \
            -I.  -DCPPFLAGS_TEST  -I../../src/include -O2 -march=native -pipe -g \
            -frecord-gcc-switches -freport-bug -Wimplicit-function-declaration \
            -Wnonnull -Wstrict-aliasing -Wparentheses -Warray-bounds \
            -Wfree-nonheap-object -Wreturn-local-addr -fno-strict-aliasing -Wall \
            -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -c zntune.c
    In file included from /usr/include/linux/atm_zatm.h:17:0,
                     from zntune.c:17:
    /usr/include/linux/time.h:9:8: error: redefinition of ‘struct timespec’
     struct timespec {
            ^
    In file included from /usr/include/sys/select.h:43:0,
                     from /usr/include/sys/types.h:219,
                     from /usr/include/stdlib.h:314,
                     from zntune.c:9:
    /usr/include/time.h:120:8: note: originally defined here
     struct timespec
            ^
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
    Acked-by: Mikko Rapeli <mikko.rapeli@iki.fi>
    Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/include/uapi/linux/atm_zatm.h b/include/uapi/linux/atm_zatm.h
index 5cd4d4d..9c9c6ad 100644
--- a/include/uapi/linux/atm_zatm.h
+++ b/include/uapi/linux/atm_zatm.h
@@ -14,7 +14,6 @@
 
 #include <linux/atmapi.h>
 #include <linux/atmioc.h>
-#include <linux/time.h>
 
 #define ZATM_GETPOOL	_IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc)
 						/* get pool statistics */

Reply to: