From owner-svn-src-all@freebsd.org Sat Nov 7 11:21:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E4ADA2746D; Sat, 7 Nov 2015 11:21:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 282931126; Sat, 7 Nov 2015 11:21:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tA7BLohH082923 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 7 Nov 2015 13:21:50 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tA7BLohH082923 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tA7BLneh082922; Sat, 7 Nov 2015 13:21:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 7 Nov 2015 13:21:49 +0200 From: Konstantin Belousov To: Bruce Evans Cc: Svatopluk Kraus , "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r290475 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20151107112149.GV2257@kib.kiev.ua> References: <201511070143.tA71h13k038232@repo.freebsd.org> <20151107205927.P1514@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151107205927.P1514@besplex.bde.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Nov 2015 11:21:56 -0000 On Sat, Nov 07, 2015 at 09:25:32PM +1100, Bruce Evans wrote: > On Sat, 7 Nov 2015, Svatopluk Kraus wrote: > > > You broke buildkernel. The following patch helps: > > > > diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h > > index 950e712..a34c890 100644 > > --- a/sys/sys/sysctl.h > > +++ b/sys/sys/sysctl.h > > @@ -37,6 +37,7 @@ > > #define _SYS_SYSCTL_H_ > > > > #include > > +#include > > > > struct thread; > > /* > > This adds namespace pollution. It shouldn't be needed. > is standard namespace pollution in . (It has a bogus > comment there describing only one thing that it is for.) > > This pollution is already in dnv.h, nv.h and racct.h. > > > @@ -949,7 +950,7 @@ extern char kern_ident[]; > > /* Dynamic oid handling */ > > struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist, > > struct sysctl_oid_list *parent, int nbr, const char *name, int kind, > > - void *arg1, intptr_t arg2, int (*handler)(SYSCTL_HANDLER_ARGS), > > + void *arg1, intmax_t arg2, int (*handler)(SYSCTL_HANDLER_ARGS), > > const char *fmt, const char *descr); > > int sysctl_remove_name(struct sysctl_oid *parent, const char *name, int del, > > int recurse); > > Apparently the original change wasn't tested on 32-bit arches. > > I put intptr_t in long ago, since it was more needed and > less magic than intmax_t. This was obfuscated by moving it to > and including that in various places. intmax_t is > still only in which is much larger. It and uintmax_t > should be together with intptr_t. That is more polluting in theory > but less in practice. > > doesn't declare much else directly, but includes > for the most important types (fixed-width ones). It > mainly declares least-width and fast-width types directly. These > should be used in most cases where fixed-width types are now used, > especially in kernels, but their usability is shown by them almost > never being used. In other words, do you suggest the following change to fix the compilation ? diff --git a/sys/sys/_stdint.h b/sys/sys/_stdint.h index d0f9249..a0fe0ad 100644 --- a/sys/sys/_stdint.h +++ b/sys/sys/_stdint.h @@ -78,5 +78,13 @@ typedef __intptr_t intptr_t; typedef __uintptr_t uintptr_t; #define _UINTPTR_T_DECLARED #endif +#ifndef _INTMAX_T_DECLARED +typedef __intmax_t intmax_t; +#define _INTMAX_T_DECLARED +#endif +#ifndef _UINTMAX_T_DECLARED +typedef __uintmax_t uintmax_t; +#define _UINTMAX_T_DECLARED +#endif #endif /* !_SYS__STDINT_H_ */ diff --git a/sys/sys/stdint.h b/sys/sys/stdint.h index 762e879..ec3698b 100644 --- a/sys/sys/stdint.h +++ b/sys/sys/stdint.h @@ -55,15 +55,6 @@ typedef __uint_fast16_t uint_fast16_t; typedef __uint_fast32_t uint_fast32_t; typedef __uint_fast64_t uint_fast64_t; -#ifndef _INTMAX_T_DECLARED -typedef __intmax_t intmax_t; -#define _INTMAX_T_DECLARED -#endif -#ifndef _UINTMAX_T_DECLARED -typedef __uintmax_t uintmax_t; -#define _UINTMAX_T_DECLARED -#endif - /* GNU and Darwin define this and people seem to think it's portable */ #if defined(UINTPTR_MAX) && defined(UINT64_MAX) && (UINTPTR_MAX == UINT64_MAX) #define __WORDSIZE 64 diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 950e712..f3e2d68 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -949,7 +949,7 @@ extern char kern_ident[]; /* Dynamic oid handling */ struct sysctl_oid *sysctl_add_oid(struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent, int nbr, const char *name, int kind, - void *arg1, intptr_t arg2, int (*handler)(SYSCTL_HANDLER_ARGS), + void *arg1, intmax_t arg2, int (*handler)(SYSCTL_HANDLER_ARGS), const char *fmt, const char *descr); int sysctl_remove_name(struct sysctl_oid *parent, const char *name, int del, int recurse);