From 383f241dce091911b9466f49c19c8746b233ba3e Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 23 Nov 2017 11:40:16 +0000 Subject: [PATCH] Remove lint support from system headers and MD x86 headers. Reviewed by: dim, jhb Discussed with: imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D13156 --- include/stdlib.h | 10 +++------- sys/amd64/include/asm.h | 4 ++-- sys/amd64/include/pcpu.h | 17 +++-------------- sys/amd64/include/profile.h | 4 ---- sys/i386/include/asm.h | 4 ++-- sys/i386/include/pcpu.h | 17 +++-------------- sys/i386/include/profile.h | 4 ---- sys/sys/cdefs.h | 18 +++--------------- sys/sys/linker_set.h | 3 --- sys/sys/param.h | 2 -- sys/x86/include/_types.h | 6 ------ sys/x86/include/bus.h | 4 +--- sys/x86/include/stdarg.h | 12 ------------ sys/x86/include/ucontext.h | 5 ----- 14 files changed, 17 insertions(+), 93 deletions(-) diff --git a/include/stdlib.h b/include/stdlib.h index f2d45e418e46..93c4bb50cd79 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -238,17 +238,13 @@ extern void (*malloc_message)(void *, const char *); /* * The alloca() function can't be implemented in C, and on some * platforms it can't be implemented at all as a callable function. - * The GNU C compiler provides a built-in alloca() which we can use; - * in all other cases, provide a prototype, mainly to pacify various - * incarnations of lint. On platforms where alloca() is not in libc, - * programs which use it will fail to link when compiled with non-GNU - * compilers. + * The GNU C compiler provides a built-in alloca() which we can use. + * On platforms where alloca() is not in libc, programs which use it + * will fail to link when compiled with non-GNU compilers. */ #if __GNUC__ >= 2 || defined(__INTEL_COMPILER) #undef alloca /* some GNU bits try to get cute and define this on their own */ #define alloca(sz) __builtin_alloca(sz) -#elif defined(lint) -void *alloca(size_t); #endif void abort2(const char *, int, void **) __dead2; diff --git a/sys/amd64/include/asm.h b/sys/amd64/include/asm.h index 1db8de6433f9..bebc4df3d2c5 100644 --- a/sys/amd64/include/asm.h +++ b/sys/amd64/include/asm.h @@ -92,10 +92,10 @@ #define RCSID(x) .text; .asciz x #undef __FBSDID -#if !defined(lint) && !defined(STRIP_FBSDID) +#if !defined(STRIP_FBSDID) #define __FBSDID(s) .ident s #else #define __FBSDID(s) /* nothing */ -#endif /* not lint and not STRIP_FBSDID */ +#endif /* !STRIP_FBSDID */ #endif /* !_MACHINE_ASM_H_ */ diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index af5e889f2107..16db9edc425f 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -74,18 +74,7 @@ #ifdef _KERNEL -#ifdef lint - -extern struct pcpu *pcpup; - -#define get_pcpu() (pcpup) -#define PCPU_GET(member) (pcpup->pc_ ## member) -#define PCPU_ADD(member, val) (pcpup->pc_ ## member += (val)) -#define PCPU_INC(member) PCPU_ADD(member, 1) -#define PCPU_PTR(member) (&pcpup->pc_ ## member) -#define PCPU_SET(member, val) (pcpup->pc_ ## member = (val)) - -#elif defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) +#if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) /* * Evaluates to the byte offset of the per-cpu variable name. @@ -251,11 +240,11 @@ __curpcb(void) #define IS_BSP() (PCPU_GET(cpuid) == 0) -#else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ +#else /* !__GNUCLIKE_ASM || !__GNUCLIKE___TYPEOF */ #error "this file needs to be ported to your compiler" -#endif /* lint, etc. */ +#endif /* __GNUCLIKE_ASM && __GNUCLIKE___TYPEOF */ #endif /* _KERNEL */ diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h index aba7910d589c..97af17d5e662 100644 --- a/sys/amd64/include/profile.h +++ b/sys/amd64/include/profile.h @@ -71,10 +71,6 @@ : "ax", "dx", "cx", "di", "si", "r8", "r9", "memory") #define MEXITCOUNT_OVERHEAD_GETLABEL(labelp) \ __asm __volatile("movq $1b,%0" : "=rm" (labelp)) -#elif defined(lint) -#define MCOUNT_OVERHEAD(label) -#define MEXITCOUNT_OVERHEAD() -#define MEXITCOUNT_OVERHEAD_GETLABEL() #else #error this file needs to be ported to your compiler #endif /* !__GNUCLIKE_ASM */ diff --git a/sys/i386/include/asm.h b/sys/i386/include/asm.h index 27472485de10..f45978455056 100644 --- a/sys/i386/include/asm.h +++ b/sys/i386/include/asm.h @@ -113,10 +113,10 @@ #define RCSID(x) .text; .asciz x #undef __FBSDID -#if !defined(lint) && !defined(STRIP_FBSDID) +#if !defined(STRIP_FBSDID) #define __FBSDID(s) .ident s #else #define __FBSDID(s) /* nothing */ -#endif /* not lint and not STRIP_FBSDID */ +#endif /* not STRIP_FBSDID */ #endif /* !_MACHINE_ASM_H_ */ diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h index 30a06badc8ba..d8c6f7957bb4 100644 --- a/sys/i386/include/pcpu.h +++ b/sys/i386/include/pcpu.h @@ -72,18 +72,7 @@ #ifdef _KERNEL -#ifdef lint - -extern struct pcpu *pcpup; - -#define get_pcpu() (pcpup) -#define PCPU_GET(member) (pcpup->pc_ ## member) -#define PCPU_ADD(member, val) (pcpup->pc_ ## member += (val)) -#define PCPU_INC(member) PCPU_ADD(member, 1) -#define PCPU_PTR(member) (&pcpup->pc_ ## member) -#define PCPU_SET(member, val) (pcpup->pc_ ## member = (val)) - -#elif defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) +#if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) /* * Evaluates to the byte offset of the per-cpu variable name. @@ -242,11 +231,11 @@ __curpcb(void) } #define curpcb (__curpcb()) -#else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ +#else /* defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ #error "this file needs to be ported to your compiler" -#endif /* lint, etc. */ +#endif /* __GNUCLIKE_ASM etc. */ #endif /* _KERNEL */ diff --git a/sys/i386/include/profile.h b/sys/i386/include/profile.h index 9b4a68a06cf9..5ebe287e1061 100644 --- a/sys/i386/include/profile.h +++ b/sys/i386/include/profile.h @@ -71,10 +71,6 @@ : "ax", "dx", "cx", "memory") #define MEXITCOUNT_OVERHEAD_GETLABEL(labelp) \ __asm __volatile("movl $1b,%0" : "=rm" (labelp)) -#elif defined(lint) -#define MCOUNT_OVERHEAD(label) -#define MEXITCOUNT_OVERHEAD() -#define MEXITCOUNT_OVERHEAD_GETLABEL() #else #error #endif /* !__GNUCLIKE_ASM */ diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 1686e1c73d21..bef96e23beb7 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -207,17 +207,6 @@ * for a given compiler, let the compile fail if it is told to use * a feature that we cannot live without. */ -#ifdef lint -#define __dead2 -#define __pure2 -#define __unused -#define __packed -#define __aligned(x) -#define __alloc_align(x) -#define __alloc_size(x) -#define __section(x) -#define __weak_symbol -#else #define __weak_symbol __attribute__((__weak__)) #if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) #define __dead2 @@ -249,7 +238,6 @@ #else #define __alloc_align(x) #endif -#endif /* lint */ #if !__GNUC_PREREQ__(2, 95) #define __alignof(x) __offsetof(struct { char __a; x __b; }, __b) @@ -259,7 +247,7 @@ * Keywords added in C11. */ -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || defined(lint) +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L #if !__has_extension(c_alignas) #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ @@ -425,7 +413,7 @@ * software that is unaware of C99 keywords. */ #if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint) +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 #define __restrict #else #define __restrict restrict @@ -819,7 +807,7 @@ */ #if __has_attribute(__argument_with_type_tag__) && \ - __has_attribute(__type_tag_for_datatype__) && !defined(lint) + __has_attribute(__type_tag_for_datatype__) #define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \ __attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx))) #define __datatype_type_tag(kind, type) \ diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h index eaffcd143683..3488f9cf4801 100644 --- a/sys/sys/linker_set.h +++ b/sys/sys/linker_set.h @@ -61,10 +61,7 @@ __set_##set##_sym_##sym __section("set_" #set) \ __used = &(sym) #else /* !__GNUCLIKE___SECTION */ -#ifndef lint #error this file needs to be ported to your compiler -#endif /* lint */ -#define __MAKE_SET(set, sym) extern void const * const (__set_##set##_sym_##sym) #endif /* __GNUCLIKE___SECTION */ /* diff --git a/sys/sys/param.h b/sys/sys/param.h index 565907675519..723f7c0c4bd5 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -321,7 +321,6 @@ __END_DECLS #endif #endif -#ifndef lint #ifndef _BYTEORDER_FUNC_DEFINED #define _BYTEORDER_FUNC_DEFINED #define htonl(x) __htonl(x) @@ -329,7 +328,6 @@ __END_DECLS #define ntohl(x) __ntohl(x) #define ntohs(x) __ntohs(x) #endif /* !_BYTEORDER_FUNC_DEFINED */ -#endif /* lint */ #endif /* _KERNEL */ /* diff --git a/sys/x86/include/_types.h b/sys/x86/include/_types.h index c9a7787fcab6..bfcfee98c026 100644 --- a/sys/x86/include/_types.h +++ b/sys/x86/include/_types.h @@ -62,15 +62,9 @@ typedef unsigned int __uint32_t; typedef long __int64_t; typedef unsigned long __uint64_t; #else -#ifndef lint __extension__ -#endif -/* LONGLONG */ typedef long long __int64_t; -#ifndef lint __extension__ -#endif -/* LONGLONG */ typedef unsigned long long __uint64_t; #endif diff --git a/sys/x86/include/bus.h b/sys/x86/include/bus.h index 91de8cb26855..e78875e858b2 100644 --- a/sys/x86/include/bus.h +++ b/sys/x86/include/bus.h @@ -101,9 +101,7 @@ #include #ifndef __GNUCLIKE_ASM -# ifndef lint -# error "no assembler code for your compiler" -# endif +#error "no assembler code for your compiler" #endif /* diff --git a/sys/x86/include/stdarg.h b/sys/x86/include/stdarg.h index db8e4623a89c..ec73e4f42cce 100644 --- a/sys/x86/include/stdarg.h +++ b/sys/x86/include/stdarg.h @@ -60,18 +60,6 @@ typedef __va_list va_list; #define va_end(ap) \ __builtin_va_end(ap) -#elif defined(lint) -/* Provide a fake implementation for lint's benefit */ -#define __va_size(type) \ - (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) -#define va_start(ap, last) \ - ((ap) = (va_list)&(last) + __va_size(last)) -#define va_copy(dst, src) \ - ((dst) = (src)) -#define va_arg(ap, type) \ - (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) -#define va_end(ap) - #else #error this file needs to be ported to your compiler #endif diff --git a/sys/x86/include/ucontext.h b/sys/x86/include/ucontext.h index c429fd5b0e3a..2173efd590cf 100644 --- a/sys/x86/include/ucontext.h +++ b/sys/x86/include/ucontext.h @@ -162,9 +162,4 @@ typedef struct __mcontext { } mcontext_t; #endif /* __amd64__ */ -#ifdef __LINT__ -typedef struct __mcontext { -} mcontext_t; -#endif /* __LINT__ */ - #endif /* !_X86_UCONTEXT_H_ */