Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkrGI-0001GS-Iw for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Aug 2018 13:33:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fkrGG-0001PI-Hf for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Aug 2018 13:33:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkrGG-0001PA-6x for pgsql-hackers@lists.postgresql.org; Wed, 01 Aug 2018 13:33:56 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fkrGD-0006Db-Dy for pgsql-hackers@postgresql.org; Wed, 01 Aug 2018 13:33:55 +0000 Received: by mail-wm0-x244.google.com with SMTP id s12-v6so7045869wmc.0 for ; Wed, 01 Aug 2018 06:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=EFHUFpj12xvNdDWyXQ6Q09iFrDRImFlyiOh2PY4mrpk=; b=MC9CdRjha/rVt9SiWeQ6LnQ+GPpYsS50tq6HnPk+UX7DDUzJWXieYyj2Y98zICMNAd 1KbpDcJqWypmzZ2F4qA0nUQSLXJGcQH/4e4TeTdxsR9NIieyIXFIoInborr/1LXSD8aP n568N7u++nDtZhaquUwfsagLEDVAmDvry4hFWMF18MnjSHZTwUzrE/vIIPK52JD2XbgZ LCOleKItvTQARgZquvCldKa+vWfXUGy00n54jWUlbtf4apybMbDvbp3BtJD5009H8kRk J2KPVAGH4+subQz4jmCbYWhuh4rFatXY7403FICwi4dk8xEx9BtsX2XiHTG2HqN0jHGg l5Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EFHUFpj12xvNdDWyXQ6Q09iFrDRImFlyiOh2PY4mrpk=; b=NBdTCVEs47qCdNqLgNDiXHfDZty2yVBxYTdXk69Rj0peY7GppMSRnscJ1JHuhCpxAx cUIRmHL4tXoCEj1evMRhM/kylNfh5xpCYX0PonZE709QL6R36aHPN9Tk1NTEdStgiha6 lVIkNNp5QZpYGIIJRxOhubxwjxV/U9qodH0AI4PivrTZ3jSjvd08JotScfNQdkfddjvj WNzzDv47oadv3QGDWOUiOJukQ+JdtabTVg9TnDyr0t9K+0xKhQRKANX6oU+TEeGZgxvV g/jGA+2k0T0wnkQeMVlbvPn/b8rkKDbc4RDEgHjq90AARuvAOe93RL9wIZcPL4BLdVLj ax5A== X-Gm-Message-State: AOUpUlFRunldGgIygC/dcp7VLELMwBUrjsJZScgMg8oX9vZH1Af50e+2 woy/XWk5L+d7Xk9Ovr986fjIo8WirV0gYVMEe+mmNMOtX+INNw3G2jVo0VvQYhCfAq0kZRojhDl 968YPhY2hCYFwnqBF25C1odLqMjxMS8KAOxQk9iPjnk87bU7H5qzIXr3oMpGX+M2Rz6det+An+v tA9g9ZK7y+fS4= X-Google-Smtp-Source: AAOMgpcemiYjYejxpFBlcPmNNu9OCSv5qnpSv+xdr14juu9PLz2sfHeRvkPdjzSCF+609cepX7uvYQ== X-Received: by 2002:a1c:b484:: with SMTP id d126-v6mr2834819wmf.17.1533130431574; Wed, 01 Aug 2018 06:33:51 -0700 (PDT) Received: from [10.137.2.21] (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id v124-v6sm6873592wma.18.2018.08.01.06.33.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 06:33:50 -0700 (PDT) Subject: Re: New Defects reported by Coverity Scan for PostgreSQL To: emre@hasegeli.com, Tom Lane Cc: Ning Yu , Alvaro Herrera , Pg Hackers References: <20180731172149.kdjl3xdjjtwxaj4s@alvherre.pgsql> <26769.1533090136@sss.pgh.pa.us> From: Tomas Vondra Message-ID: <5fece6c5-6a80-9694-1a24-3ae245ae2cba@2ndquadrant.com> Date: Wed, 1 Aug 2018 15:33:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 08/01/2018 11:55 AM, Emre Hasegeli wrote: >> Or perhaps I have it backwards and "l1" and "l2" need to be swapped in >> that description. But the mere fact that there is any question about >> that means that the function is poorly documented and perhaps poorly >> named as well. For that matter, is there a good reason why l1/l2 >> have those roles and not the reverse? > > Consistency. I organized all xxx_closept_yyy(Point *result, xxx *l1, > yyy *l2) functions in a way that they find the find the point on "l1". > IMHO the main issue here is that the rule is not obvious / documented anywhere. I think the best way to do that is by making it clear in a comment for each such such function. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services