From 381fa6da48f61b44a92fbaf73b2f65e40c705e14 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 2 Mar 2014 20:16:26 +0100 Subject: [PATCH] Some fixes to allow building with gcc44. Most of them for type redefinitions which gcc47 has stopped warning about (if they are compatible). The libstdc++ fix is modeled after gcc47's libstdc++. We don't have __libc_C_ctype_[] anymore. --- .../config/os/bsd/dragonfly/ctype_noninline.h | 8 +++++--- lib/libc/sysvipc/sockets.c | 2 +- share/mk/bsd.sys.mk | 4 ++++ sys/dev/drm/include/drm/drmP.h | 2 -- sys/dev/drm/include/linux/types.h | 1 - sys/dev/netif/ath/ath_hal/ar5416/ar5416_reset.c | 1 + sys/platform/pc32/include/pmap.h | 6 ++++++ sys/platform/pc64/include/pmap.h | 6 ++++++ sys/platform/vkernel/include/pmap.h | 6 ++++++ sys/platform/vkernel64/include/pmap.h | 7 ++++++- sys/sys/stdint.h | 6 ++++++ sys/sys/types.h | 6 ++++++ sys/vm/vm.h | 3 +++ 13 files changed, 50 insertions(+), 8 deletions(-) diff --git a/contrib/gcc-4.4/libstdc++-v3/config/os/bsd/dragonfly/ctype_noninline.h b/contrib/gcc-4.4/libstdc++-v3/config/os/bsd/dragonfly/ctype_noninline.h index dd4e2e2639..f3aa724702 100644 --- a/contrib/gcc-4.4/libstdc++-v3/config/os/bsd/dragonfly/ctype_noninline.h +++ b/contrib/gcc-4.4/libstdc++-v3/config/os/bsd/dragonfly/ctype_noninline.h @@ -34,15 +34,17 @@ // Information as gleaned from /usr/include/ctype.h -#ifdef _CTYPE_S - extern "C" const unsigned long __libc_C_ctype_[]; -#else +#ifndef _CTYPE_S extern "C" const __uint16_t __libc_C_ctype_[]; #endif const ctype_base::mask* ctype::classic_table() throw() +#ifdef _CTYPE_S + { return 0; } +#else { return __libc_C_ctype_ + 1; } +#endif ctype::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) diff --git a/lib/libc/sysvipc/sockets.c b/lib/libc/sysvipc/sockets.c index ec95e59116..59e993f73b 100644 --- a/lib/libc/sysvipc/sockets.c +++ b/lib/libc/sysvipc/sockets.c @@ -281,7 +281,7 @@ send_msg_with_cred(int sock, char *buffer, size_t size) { int receive_msg_with_cred(int sock, char *buffer, size_t size, struct cmsgcred *cred) { - struct msghdr msg = {0}; + struct msghdr msg = { .msg_name = NULL }; struct iovec vec; ssize_t n; int result; diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index a6fc792184..aa805eb7e6 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -47,7 +47,11 @@ CWARNFLAGS += -Wchar-subscripts -Winline -Wnested-externs\ . if ${WARNS} >= 2 && ${WARNS} <= 4 # XXX Delete -Wmaybe-uninitialized by default for now -- the compiler doesn't # XXX always get it right. +. if ${CCVER} == "gcc47" CWARNFLAGS += -Wno-maybe-uninitialized +. else +CWARNFLAGS += -Wno-uninitialized +. endif . endif # Activate gcc47's -Wunused-but-set-variable (which is in -Wall) and # -Wunused-but-set-parameter (which is in -Wextra) only at WARNS >= 4 diff --git a/sys/dev/drm/include/drm/drmP.h b/sys/dev/drm/include/drm/drmP.h index f691e84009..1fbf171072 100644 --- a/sys/dev/drm/include/drm/drmP.h +++ b/sys/dev/drm/include/drm/drmP.h @@ -668,8 +668,6 @@ struct drm_ati_pcigart_info { struct drm_dma_handle *dmah; /* handle for ATI PCIGART table */ }; -typedef vm_paddr_t resource_size_t; - /** * GEM specific mm private for tracking GEM objects */ diff --git a/sys/dev/drm/include/linux/types.h b/sys/dev/drm/include/linux/types.h index 118e62f9e7..9b78365d9f 100644 --- a/sys/dev/drm/include/linux/types.h +++ b/sys/dev/drm/include/linux/types.h @@ -50,7 +50,6 @@ typedef _Bool bool; typedef u64 phys_addr_t; typedef unsigned long kernel_ulong_t; -typedef unsigned int uint; typedef unsigned gfp_t; typedef uint64_t loff_t; typedef vm_paddr_t resource_size_t; diff --git a/sys/dev/netif/ath/ath_hal/ar5416/ar5416_reset.c b/sys/dev/netif/ath/ath_hal/ar5416/ar5416_reset.c index eb31f08a49..bb87ca9ba6 100644 --- a/sys/dev/netif/ath/ath_hal/ar5416/ar5416_reset.c +++ b/sys/dev/netif/ath/ath_hal/ar5416/ar5416_reset.c @@ -2439,6 +2439,7 @@ ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, int16_t minDelta = 0; CHAN_CENTERS centers; + minPwrT4[0] = 0; /* XXX make gcc44 happy */ ar5416GetChannelCenters(ah, chan, ¢ers); /* Trim numPiers for the number of populated channel Piers */ diff --git a/sys/platform/pc32/include/pmap.h b/sys/platform/pc32/include/pmap.h index f168a32039..4c84eb7caf 100644 --- a/sys/platform/pc32/include/pmap.h +++ b/sys/platform/pc32/include/pmap.h @@ -303,8 +303,14 @@ extern vm_offset_t clean_eva; extern vm_offset_t clean_sva; extern char *ptvmmap; /* poor name! */ +#ifndef __VM_PAGE_T_DEFINED__ +#define __VM_PAGE_T_DEFINED__ typedef struct vm_page *vm_page_t; +#endif +#ifndef __VM_MEMATTR_T_DEFINED__ +#define __VM_MEMATTR_T_DEFINED__ typedef char vm_memattr_t; +#endif void pmap_release(struct pmap *pmap); void pmap_interlock_wait (struct vmspace *); diff --git a/sys/platform/pc64/include/pmap.h b/sys/platform/pc64/include/pmap.h index cc413dca40..d09934f520 100644 --- a/sys/platform/pc64/include/pmap.h +++ b/sys/platform/pc64/include/pmap.h @@ -351,8 +351,14 @@ extern vm_offset_t clean_eva; extern vm_offset_t clean_sva; extern char *ptvmmap; /* poor name! */ +#ifndef __VM_PAGE_T_DEFINED__ +#define __VM_PAGE_T_DEFINED__ typedef struct vm_page *vm_page_t; +#endif +#ifndef __VM_MEMATTR_T_DEFINED__ +#define __VM_MEMATTR_T_DEFINED__ typedef char vm_memattr_t; +#endif void pmap_release(struct pmap *pmap); void pmap_interlock_wait (struct vmspace *); diff --git a/sys/platform/vkernel/include/pmap.h b/sys/platform/vkernel/include/pmap.h index 184b3aa4f0..f372f195b7 100644 --- a/sys/platform/vkernel/include/pmap.h +++ b/sys/platform/vkernel/include/pmap.h @@ -176,8 +176,14 @@ extern char *ptvmmap; /* poor name! */ extern vm_offset_t clean_sva; extern vm_offset_t clean_eva; +#ifndef __VM_PAGE_T_DEFINED__ +#define __VM_PAGE_T_DEFINED__ typedef struct vm_page *vm_page_t; +#endif +#ifndef __VM_MEMATTR_T_DEFINED__ +#define __VM_MEMATTR_T_DEFINED__ typedef char vm_memattr_t; +#endif void pmap_bootstrap (void); void *pmap_mapdev (vm_paddr_t, vm_size_t); diff --git a/sys/platform/vkernel64/include/pmap.h b/sys/platform/vkernel64/include/pmap.h index f7527d167f..80b1573b59 100644 --- a/sys/platform/vkernel64/include/pmap.h +++ b/sys/platform/vkernel64/include/pmap.h @@ -43,7 +43,6 @@ * from: hp300: @(#)pmap.h 7.2 (Berkeley) 12/16/90 * from: @(#)pmap.h 7.4 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/include/pmap.h,v 1.65.2.3 2001/10/03 07:15:37 peter Exp $ - * $DragonFly: src/sys/platform/vkernel/include/pmap.h,v 1.4 2007/07/01 02:51:44 dillon Exp $ */ #ifndef _MACHINE_PMAP_H_ @@ -203,8 +202,14 @@ extern char *ptvmmap; /* poor name! */ extern vm_offset_t clean_sva; extern vm_offset_t clean_eva; +#ifndef __VM_PAGE_T_DEFINED__ +#define __VM_PAGE_T_DEFINED__ typedef struct vm_page *vm_page_t; +#endif +#ifndef __VM_MEMATTR_T_DEFINED__ +#define __VM_MEMATTR_T_DEFINED__ typedef char vm_memattr_t; +#endif void pmap_bootstrap(vm_paddr_t *, int64_t); void *pmap_mapdev (vm_paddr_t, vm_size_t); diff --git a/sys/sys/stdint.h b/sys/sys/stdint.h index dff08ab7e7..6489f331b7 100644 --- a/sys/sys/stdint.h +++ b/sys/sys/stdint.h @@ -29,8 +29,14 @@ #ifndef __cplusplus typedef int __wchar_t; #endif +#ifndef ___WINT_T_DECLARED typedef int __wint_t; +#define ___WINT_T_DECLARED +#endif +#ifndef ___RUNE_T_DECLARED typedef int __rune_t; +#define ___RUNE_T_DECLARED +#endif typedef void *__wctrans_t; typedef void *__wctype_t; diff --git a/sys/sys/types.h b/sys/sys/types.h index 41065dcb0b..461949f336 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -256,8 +256,14 @@ __END_DECLS * must be at least 16 bits. */ typedef int __ct_rune_t; /* arg type for ctype funcs */ +#ifndef ___RUNE_T_DECLARED typedef __ct_rune_t __rune_t; /* rune_t (see above) */ +#define ___RUNE_T_DECLARED +#endif +#ifndef ___WINT_T_DECLARED typedef __ct_rune_t __wint_t; /* wint_t (see above) */ +#define ___WINT_T_DECLARED +#endif /* * Also required for locale support diff --git a/sys/vm/vm.h b/sys/vm/vm.h index 460388599a..f04b3e8642 100644 --- a/sys/vm/vm.h +++ b/sys/vm/vm.h @@ -121,7 +121,10 @@ typedef struct vm_page *vm_page_t; /* Memory attributes. */ +#ifndef __VM_MEMATTR_T_DEFINED__ +#define __VM_MEMATTR_T_DEFINED__ typedef char vm_memattr_t; +#endif #define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHEABLE) #define VM_MEMATTR_WRITE_COMBINING ((vm_memattr_t)PAT_WRITE_COMBINING) -- 2.41.0