From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTPS id 8E37D5D5 for ; Sun, 24 Jan 2021 14:08:47 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.79,371,1602540000"; d="scan'208";a="488735910" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 24 Jan 2021 15:08:46 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id F3708E0129; Sun, 24 Jan 2021 15:08:45 +0100 (CET) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id D1B21E00A6 for ; Sun, 24 Jan 2021 15:08:42 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=hendrik@topoi.pooq.com; spf=None smtp.mailfrom=hendrik@topoi.pooq.com; spf=None smtp.helo=postmaster@april.topoi.pooq.com IronPort-PHdr: =?us-ascii?q?9a23=3AVsJrjhYYQochDpMYsQszJe7/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZr8i7bnLW6fgltlLVR4KTs6sC17OH9fq5EjBaqdbZ6TZeKcMKD0dEwe?= =?us-ascii?q?wt3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEt?= =?us-ascii?q?fre9FYHdldm42P6v8JPPfQpImCC9YbRvJxmqsAndrMYbjZZmJ6or1BfFv3REdu?= =?us-ascii?q?tIyWh1IV6fgwvw6t2/8ZJ+8Slcoe4t+9JFXa7nY6k2ULtUASg8PWso/sPrrx7D?= =?us-ascii?q?TQWO5nsYTGoblwdDDhbG4h/nQJr/qzP2ueVh1iaUO832Vq00Vi+576h3Uh/oiT?= =?us-ascii?q?wIOCA//WrKl8F/lqNboBampxxi347ZZZyeOfRicq/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?q?SdKjU2loEoABhuQWakM4IO2MywjZ1nP0UaMSj7uKQoQz9bua1H/0dZ5w?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0C+CADifQ1g/4aDpUViHgEBCxIMQIFRg?= =?us-ascii?q?3YhEoQpiUqIVAOcQQsBAwE5AQIEAQGESgKBeR4GBjQTAhABAQUBAQECAQMDBAF?= =?us-ascii?q?whW1DARABgWMigxoBBTpPCxguLCuGRrJOdIE0hVmDOIFEgTgBhWYSPYcIQYIAg?= =?us-ascii?q?UeCNS4+hQuFLASCRnoJCkNcToEInHeaSoERgwGBHZpDDyKBI6FVsR4ThlkjgVc?= =?us-ascii?q?zGggbFTuCak8ZDZ0IJmcCBgoBAQMJWQEBggGJOQEB?= X-IPAS-Result: =?us-ascii?q?A0C+CADifQ1g/4aDpUViHgEBCxIMQIFRg3YhEoQpiUqIVAO?= =?us-ascii?q?cQQsBAwE5AQIEAQGESgKBeR4GBjQTAhABAQUBAQECAQMDBAFwhW1DARABgWMig?= =?us-ascii?q?xoBBTpPCxguLCuGRrJOdIE0hVmDOIFEgTgBhWYSPYcIQYIAgUeCNS4+hQuFLAS?= =?us-ascii?q?CRnoJCkNcToEInHeaSoERgwGBHZpDDyKBI6FVsR4ThlkjgVczGggbFTuCak8ZD?= =?us-ascii?q?Z0IJmcCBgoBAQMJWQEBggGJOQEB?= X-IronPort-AV: E=Sophos;i="5.79,371,1602540000"; d="scan'208";a="488735880" X-MGA-submission: =?us-ascii?q?MDGQwBN97+L40tgXPvxNvTB2bb8YsNBnPDOD2b?= =?us-ascii?q?v4unukICx5W0TMI7JobmmarA8wJnGvEvcNbgYyAPdfPuKre9Q1QSkGyO?= =?us-ascii?q?J/4qirJf/WtjxHnS/yn++7zinGdykBUQytE/e+3eG4mm4yBMMXiYFA2n?= =?us-ascii?q?lE1/if4nDHecgdrfI9LolS9A=3D=3D?= Received: from topoi.pooq.com (HELO april.topoi.pooq.com) ([69.165.131.134]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Jan 2021 15:08:41 +0100 Received: by april.topoi.pooq.com (Postfix, from userid 1001) id 1070CC20A1; Sun, 24 Jan 2021 09:08:38 -0500 (EST) Date: Sun, 24 Jan 2021 09:08:38 -0500 From: Hendrik Boom To: caml-list@inria.fr Message-ID: <20210124140838.hnx2eeqn7xdvq624@topoi.pooq.com> References: <41485ac7-50cf-08fe-4206-b9f863c4d2f5@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41485ac7-50cf-08fe-4206-b9f863c4d2f5@web.de> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [Caml-list] Detecting missed checks for error indications in ML code Reply-To: Hendrik Boom X-Loop: caml-list@inria.fr X-Sequence: 18377 Errors-To: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Sun, Jan 24, 2021 at 12:42:23PM +0100, Markus Elfring wrote: > Hello, > > OCaml belongs also to the category of functional programming languages. > Thus the last expression in a function usually becomes the result of > the data processing which was specified in a ML source file. > This would usually happen also if the return value from a function call > indicates an error code (when a function implementation does not throw an exception > according to an error situation). > > I got the impression that corresponding error checks can occasionally be missing. > How do you think about to detect such cases by advanced source code analysis? Hard to do without knowing how the function encodes error information in its return value. For example, is it success or failure that it indicates by returning the value zero? A ver simple approach is to return a disjoint union -- a choice between a valid valid or an invalid value of another type. THen, of course, the compiler's type checker will prevent any use of the valid value without a check being performed. -- hendrik