From owner-svn-src-all@FreeBSD.ORG Tue May 19 04:34:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCA8CAD7; Tue, 19 May 2015 04:34:15 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 694EF168E; Tue, 19 May 2015 04:34:14 +0000 (UTC) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id B7454D6769C; Tue, 19 May 2015 14:34:03 +1000 (AEST) Date: Tue, 19 May 2015 14:34:02 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pedro Giffuni cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283088 - head/sys/ddb In-Reply-To: <406A7AE3-1891-4B2C-B917-14C150EBBAB5@FreeBSD.org> Message-ID: <20150519135341.R2157@besplex.bde.org> References: <201505182227.t4IMRljx078812@svn.freebsd.org> <20150519113755.U1840@besplex.bde.org> <406A7AE3-1891-4B2C-B917-14C150EBBAB5@FreeBSD.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QeFf4Krv c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=c3-DdYJoA5YA:10 a=1ViKctDbZO8BGuLCIr0A:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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: Tue, 19 May 2015 04:34:15 -0000 On Mon, 18 May 2015, Pedro Giffuni wrote: >> Il giorno 18/mag/2015, alle ore 20:48, Bruce Evans ha scritto: >> >> On Mon, 18 May 2015, Pedro F. Giffuni wrote: >> >>> Log: >>> ddb: stop boolean screaming. >>> >>> TRUE --> true >>> FALSE--> false >>> >>> Hinted by:=09NetBSD >> >> This is not just churn to a style regression, but a type mismatch. > > It is an attempt to reduce differences with NetBSD. For that, apply the reverse change to NetBSD. > One of the complaints of hear from newcomers to the ddb code is that > the format is old-fashioned (it still had pre-ANSI headers not long ago) > and unmaintained. It is fairly well maintained (not churned to unimprove its portability). Why would newcomers want too look at it? >>> Modified: head/sys/ddb/db_break.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/ddb/db_break.c=09Mon May 18 22:14:06 2015=09(r283087) >>> +++ head/sys/ddb/db_break.c=09Mon May 18 22:27:46 2015=09(r283088) >>> @@ -155,12 +155,12 @@ db_find_breakpoint_here(db_addr_t addr) >>> =09return db_find_breakpoint(db_map_addr(addr), addr); >>> } >>> >>> -static boolean_t=09db_breakpoints_inserted =3D TRUE; >>> +static boolean_t=09db_breakpoints_inserted =3D true; >> >> This code hasn't been churned to use the boolean type. It still uses >> boolean_t, which is plain int. TRUE and FALSE go with this type. true >> and false go with the boolean type. This probably makes no difference, >> because TRUE happens to be implemented with the same value as true and >> there are lots of implicit versions between the types. > > Yes, I noticed the return types are still ints. It doesn=E2=80=99t look d= ifficult > to convert it to use a real boolean type. In any case, I would prefer to= go > forward (using bool) instead of reverting this change. That wuld be sideways. I forgot to mention (again) in my previous reply that boolean_t is a mistak= e by me. KNF code doesn't even use the ! operator, but uses explicit comparison with 0. The boolean_t type and TRUE and FALSE are from Mach. They were used mainly in ddb and vm, and are still almost never used in kern. I used to like typedefs and a typedef for boolean types, and didn't know KNF very well, so in 1995 I moved the declaration of boolean_t from Mach vm code to sys/types.h to try to popularize it. This was a mistake. Fortunately, it is still rarely used in core kernel code. The boolean type is also almost never used for syscalls. In POSIX.1-2001, is inherited from C99, but is never used for any other POSIX API. Using it for syscalls would mainly cause portability problems. >> The boolean type is almost useless since C's type system is too weak to >> distinguish between plain int used as a boolean and pure boolean. If >> it were stronger, then it would complain about all the implicit conversi= ons >> between int and boolean, and the boolean type would be harder to use for >> other reasons. > > And I would like that to happen, but it would probably break a lot of leg= acy code. > I thought boolean_t was a transition type. It is the Mach spelling of a type suitable for holding boolean values. The= re aren't many possible spellings, but even the limited spellings cause namesp= ace problems. C99 uses the spelling _Bool for the basic type to keep away from the application namespace. Applications only get the spellings bool, true and false if they include . These spellings are very likely to conflict with application spellings for a nonstandard implementations of th= e boolean type. The kernel is not careful about this :-(. Someone added the pollution bool, true and false to sys/types.h. Otherwise, your change wouldn't have compiled. The pollution for boolean_t is not as bad. boolean_t is in the POSIX namespace for sys/types.h, and TRUE and FALSE are only defined in sys/param.h. It is interesting that true and false are macros of type int suitable for use in cpp expressions, with values precisely 0 and 1. They are just like TRUE and FALSE, except they are specified in a standard while TRUE and FALSE are not even documented in a man page AFAIK (in section 9 man pages, some functions are documented as returning TRUE or FALSE, but what these are is not documented). This makes the boolean type system even weaker than I thought, and your change not even a type error -- since true and false don't have type bool, the compiler cannot do any extra type checking for them. Bruce From owner-svn-src-all@FreeBSD.ORG Tue May 19 05:06:19 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2502E07 for ; Tue, 19 May 2015 05:06:19 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DC41198A for ; Tue, 19 May 2015 05:06:19 +0000 (UTC) Received: by wgjc11 with SMTP id c11so3914581wgj.0 for ; Mon, 18 May 2015 22:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=28g87T80/+z/BfUe6eEpOoXqm5Ms/NkoshrkCWKSnvY=; b=hUv4TZtrBSd6P4rX2OLbawhBn/IK2dPj92F3iSH3jrF58w9dYRk2XysdxueNg1XgI1 W4sDsu6b1z+GqmymQaEp7/ajhaokHccym+QUZjS3Qxu9rcy37i2EridmIvA+qfeQnCNP ME/xb5DBv8JclgQMGnlO0+Z33hAYzIeQcJFpk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=28g87T80/+z/BfUe6eEpOoXqm5Ms/NkoshrkCWKSnvY=; b=ZgH2hB9iUKUtlBJq2vUQl8tCBU/ln2vEv3Cjfext2rwwlWjCW2nBS8LHcqCP+m069t vjEKUUlr2xs/R+d3CPNzPDTcEwf6dEm5CvT0cwDF4yOgGY8+krpE10bzT/5QsCVcpKSk 0vbyQErIgYkYafSSGnHeJ7J6BwJMEDTyYIUIAMDSadi3N3G16ENUiVnt6ZcomL8D7dhf zLJe3nQXWGXKQzYlRo5RkkIw4oeP+77Yhysv6/s1sOET0YzkhO8P618cicWniFrAE9K0 CbWNp2aU6URyiSjAPNYdWHtCysSOblAEm0og4qvE44ybI/NJmmeVI1Eg00KJqh6L7S6N XpHA== X-Gm-Message-State: ALoCoQm8RXzYc8+xUtIXJ673jac5o5UQZjU335rFXJE3GbRyPZKeuyOki5RTT8GSQJi1eTLz2FRU X-Received: by 10.194.200.228 with SMTP id jv4mr49493490wjc.157.1432011977645; Mon, 18 May 2015 22:06:17 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.28.20.75 with HTTP; Mon, 18 May 2015 22:05:46 -0700 (PDT) In-Reply-To: References: <201505151825.t4FIPnxJ099637@svn.freebsd.org> <059F2C65-F92D-445C-B603-0FAE0CAF976D@gmail.com> <1431877581.91685.49.camel@freebsd.org> <7F73A915E7DF0EE8DC6149EC@atuin.in.mat.cc> <1431957864.91685.57.camel@freebsd.org> <64FE26BD563665E5F1B3D0C8@ogg.in.absolight.net> From: Eitan Adler Date: Mon, 18 May 2015 22:05:46 -0700 X-Google-Sender-Auth: l4nJSOGPfox2GbugWzXIGhZaZCI Message-ID: Subject: Re: svn commit: r282985 - in head/sys: arm/annapurna arm/annapurna/alpine arm/annapurna/alpine/hal arm/conf boot/fdt/dts/arm To: Mathieu Arnold Cc: Ed Maste , Ian Lepore , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Garrett Cooper Content-Type: text/plain; charset=UTF-8 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: Tue, 19 May 2015 05:06:20 -0000 On 18 May 2015 at 08:41, Mathieu Arnold wrote: > +--On 18 mai 2015 10:52:29 -0400 Ed Maste wrote: > | On 18 May 2015 at 10:11, Mathieu Arnold wrote: > |> > |> Mmmm, if this can be done only for base, and not for ports, sure, but > |> ports need to be able to add patches with CRLF endings, because upstream > |> software comes in all flavors, including CRLF files we need to be able > |> to patch. > | > | Sure it could, we could configure it however we want. > | > | Note that we'll likely need to support CRLF in base anyway - one > | obvious example is test cases for CRLF handling in various tools. I'd > | imagine we could add an SVN keyword like fbsd:crlf=yes, along the > | lines of fbsd:nokeywords=yes. > | > | Do you know how common CRLF or partial CRLF files are in the ports > | tree? If it's only a handful that scheme could work there too. > > $ ag -l '\r' /usr/ports/|wc -l > 95 > > there's a bit more than a handful, but it could work, yes. If you want to > have a look at a typical one, /usr/ports/shells/ibsh/files/patch-Makefile > :-) > > But I think Eitan was talking about Phabricator, in this case, it'd need to > work there too. The rule can be limited to the non-contrib portions of the source repository. If svn blocks the commit, and that's enough, that's okay, but if it will help to have phabricator report these as well, I could set that up. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams