Date: Tue, 10 May 2016 18:37:22 +0200 From: Hans Petter Selasky <hps@selasky.org> To: cem@FreeBSD.org, John Baldwin <jhb@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299363 - head/sys/compat/linuxkpi/common/include/asm Message-ID: <ec0c721e-8d69-3067-116c-d643de8e551d@selasky.org> In-Reply-To: <CAG6CVpVsR0Gr7MSRo2HRPZRYeygObM0Cqk_WbRN3L-ifmyTpUg@mail.gmail.com> References: <201605101139.u4ABdaTL098171@repo.freebsd.org> <7693af09-def2-e8a7-b7fd-9b6df41908cc@selasky.org> <4312956.Tckd6PoFKf@ralph.baldwin.cx> <CAG6CVpVsR0Gr7MSRo2HRPZRYeygObM0Cqk_WbRN3L-ifmyTpUg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 05/10/16 18:05, Conrad Meyer wrote: > On Tue, May 10, 2016 at 8:55 AM, John Baldwin <jhb@freebsd.org> wrote: >> On Tuesday, May 10, 2016 05:06:08 PM Hans Petter Selasky wrote: >>> On 05/10/16 13:39, Hans Petter Selasky wrote: >>>> Author: hselasky >>>> Date: Tue May 10 11:39:36 2016 >>>> New Revision: 299363 >>>> URL: https://svnweb.freebsd.org/changeset/base/299363 >>>> >>>> Log: >>>> Use function macros when possible to avoid stray substitutions. >>>> >>>> MFC after: 1 week >>>> Sponsored by: Mellanox Technologies >>>> >> >> Is the reason for the change to avoid accepting the wrong number of arguments >> (e.g. cpu_to_be32(x, y))? Won't that still fail to compile if so? (That is, >> the reasoning for why you made the original change isn't clear to me from the >> commit.) > > The macro form also prevents clobbering non-function-pointer variables > named "cpu_to_be32," right? Not that that's a great variable name. > Hi, That's right Conrad. My intention was to avoid substitutions outside the function domain, like in a structure like this for example: struct { int cpu_to_be32; } xxx; These functions only accepts one argument, so no problem there. --HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ec0c721e-8d69-3067-116c-d643de8e551d>