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 C0FDD5D5 for ; Mon, 25 Jan 2021 03:59:45 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.79,372,1602540000"; d="scan'208,217";a="488819134" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 25 Jan 2021 04:59:44 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id BFAD5E00C9; Mon, 25 Jan 2021 04:59:44 +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 297DBE00A6 for ; Mon, 25 Jan 2021 04:59:38 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=yawar.amin@gmail.com; spf=Pass smtp.mailfrom=yawar.amin@gmail.com; spf=None smtp.helo=postmaster@mail-oi1-f181.google.com IronPort-PHdr: =?us-ascii?q?9a23=3Akm5HkRb4PK4i+3+/y/tV51P/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZrs69bnLW6fgltlLVR4KTs6sC17OH9fq6EjFdqdbZ6TZeKcMKD0dEwe?= =?us-ascii?q?wt3CUYSPafDkP6KPO4JwcbJ+9lEGFfwnegLEJOE9z/bVCB6le77DoVBwmtfVEt?= =?us-ascii?q?fre9FYHdldm42P6v8JPPfQpImCC9YbRvJxmqsAndrMYbjZZmJ6or1BfFvHREdu?= =?us-ascii?q?RWyGh1IV6fgwvw6t2/8ZJ+8Slcoe4t+9JFXa7nY6k2ULtUASg8PWso/sPrrx7D?= =?us-ascii?q?TQWO5nsYTGoblwdDDhbG4h/nQJr/qzP2ueVh1iaUO832Vq00Vi+576h3Uh/oiT?= =?us-ascii?q?wIOCA//WrKl8F/lqNboBampxxi347ZZZyeOfRicq/Be94RWHFMVdhNWSNfHoy8?= =?us-ascii?q?bpMPD+sfMuZes4n9vEYFoR+nCQWxGO/j1jpEi3nr1qM4zushCxnL0wMuH90MsH?= =?us-ascii?q?raotb7OroMX++p16TH1ynPYulM1Dvh9ITFcBYsquyMU7JqdsrRzFEiGAHfgVSe?= =?us-ascii?q?s4PlJS6e2/gIs2ia6eprSOWiim49pAB/uDev3N0ghZPMhoIUzFDJ7ip5wIMvKt?= =?us-ascii?q?25TE53e8KrEJxVtyyDMYZ9X8wtTX1ytikg1r0GpYC0fDIMyJk/2xLTdeKLf5SV?= =?us-ascii?q?7x/nSuqcIDN1iXZmdb+7mRq/8UatxOPhW8Wp0VtGsipIn93Ru30C1xLe5MmKRP?= =?us-ascii?q?Vz80q81jiCywbe4fxKL0AzkKrUMZ8hwrgom5oWsETDAjX2l1vsgK+RbEUk9e6l?= =?us-ascii?q?4PnkbLX+vpKQKZN4hwXkPqktmsGzG/k0PwkMUmSB5Oix16Dv8EvkS7tQlPI2iL?= =?us-ascii?q?PWsJXCKMQbuKG5BwhV354m6xmlDjem1M0UnX4GLF5YYR6HgZXlNlLTLPziAve/?= =?us-ascii?q?hFOskDhvx//YJLHuHpLNLn3bnLfge7Zy9VJcxRItwdxD459YELIMLfLpVkPstd?= =?us-ascii?q?HVDAU1PxG3zur6ENl905kRWWOLAq+XKqPStlqI6/ovIuaWao4aoiz9J+I/6P7r?= =?us-ascii?q?jH85n0QQfaas3ZQNaXC4Gu5qLFmeYXrpmtsBC3sFvhIiTOz2j12PSSJcaGy3X6?= =?us-ascii?q?I4/z07DIOmDZzfRo22m7yA3CK7HoVMaWxcC1CMF23od4SeVPsWZiKSOJwprjtR?= =?us-ascii?q?crOoTotp8BivsA78xPJDL/HIsnkTvJfnkdx0/PH7lBco9DUyAd7LgE+XSGQhr2?= =?us-ascii?q?oXTiV+9aV+pwQp216c2LI+ivlZE/Rc4vpIVkExMpuKnL8yMMz7Rg+UJoTBc12h?= =?us-ascii?q?WNjzRGhpFotske9LWF50HpCZtj6G3yeuBOVLxbmCBZhx9aOFmnaod587xHHB26?= =?us-ascii?q?0syVIhR5kXbDz0tutE7wHWQrXxvQCcnqeue74b2XeUpmiGxGuK+kpfVVwpCPmX?= =?us-ascii?q?bTUkfkLT6O/ByAbaVbb3UOYoNwJAzYiJLa4YMtA=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DNAQAbQQ5gf7WnVdFihXlXMy+EQIEej?= =?us-ascii?q?iKCF4srkRkLAQMBDSMMBAEBgVWCdQKBeAIdBwEENBMCEAEBBQEBAQIBAwMEARM?= =?us-ascii?q?BAQ0LCwgnhWoMgjgpAYMSAgQSER0BGx4DDAYFBAc3AgIiAREBBQEcBhMigwWCV?= =?us-ascii?q?AEDLg+lQ4EEPYs0gRUFAReDBgaBNAGDDgoZKA0VTQOBOAIBBhKBJoVlgRYBhkI?= =?us-ascii?q?mD4FNP4FHgjUuPoJdA4ILgmyCYASDQD0CBG9QDJBsjQWbLywHgnqBGAULiAiSP?= =?us-ascii?q?yKieJ89llAQI4FKgXozGiNQMYI4UBkNkhKFFIViJjACNQIGAQkBAQMJjBUBAQ?= X-IPAS-Result: =?us-ascii?q?A0DNAQAbQQ5gf7WnVdFihXlXMy+EQIEejiKCF4srkRkLAQM?= =?us-ascii?q?BDSMMBAEBgVWCdQKBeAIdBwEENBMCEAEBBQEBAQIBAwMEARMBAQ0LCwgnhWoMg?= =?us-ascii?q?jgpAYMSAgQSER0BGx4DDAYFBAc3AgIiAREBBQEcBhMigwWCVAEDLg+lQ4EEPYs?= =?us-ascii?q?0gRUFAReDBgaBNAGDDgoZKA0VTQOBOAIBBhKBJoVlgRYBhkImD4FNP4FHgjUuP?= =?us-ascii?q?oJdA4ILgmyCYASDQD0CBG9QDJBsjQWbLywHgnqBGAULiAiSPyKieJ89llAQI4F?= =?us-ascii?q?KgXozGiNQMYI4UBkNkhKFFIViJjACNQIGAQkBAQMJjBUBAQ?= X-IronPort-AV: E=Sophos;i="5.79,372,1602540000"; d="scan'208,217";a="488819095" X-MGA-submission: =?us-ascii?q?MDEo+0E44fDFDXYevE2K7MriounLWj+5xRcGvn?= =?us-ascii?q?aEd+TuUlxYjKIQ7qAgrfkkuLdmywMeHKb++Gv46oZFUlNSRnHKqoTEUd?= =?us-ascii?q?FQDrW0NhqXUTLbTZwVj6i/RVGWyWykHOjI35lH2FrRkq70jQfed4xizx?= =?us-ascii?q?m08BuFM30cuF3JnBLJVnywEw=3D=3D?= Received: from mail-oi1-f181.google.com ([209.85.167.181]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 25 Jan 2021 04:59:36 +0100 Received: by mail-oi1-f181.google.com with SMTP id g69so12626478oib.12 for ; Sun, 24 Jan 2021 19:59:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=lV3vKjlusvCKfQs28ExwNE0Q6TPvoJeOlmdYitduD1E=; b=kNnNEZFvgUYWzPFWLZ8NyMaJG4ycnbw13/Fl6gdhmsMybWNHyPDmR8aVtMe0BH4+1t 2ocOFWskSOQU2ISAZfZeqpoSoiLZWdVGr4NoIMaDnUBXEZ2qIuJ/zIiB2uMn6EwQpCHD wHS9Rhn+9f84rCpAcW8y5IKtojxp3+LpUOf0e3bego/5qlEptxSt38KZIo4a4/rWa98I cpDf/zd91TAvB+j8JOsktYY5l9MjaHTwp3y8ZbiLGGnOEinYwcFEt7NLOU4Eoik9MGNp +RzL5b0eerVrAy09FUEyF9VX8x+ymWce3WhPwZARtGbcXrrQSvPYZY4sLud8EK1sGDrs qecg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=lV3vKjlusvCKfQs28ExwNE0Q6TPvoJeOlmdYitduD1E=; b=ANjb+m5VoY7P1U1j0Vpun2urmla8j4YOz9pCfWsG7/iOUW4ZivWO2AvthAgVFhvoXo TCDhnFVDOmGqQAChzpB5qPTLpQ3YUI7nxWW2MI7ekumiSpsqtugHwqRUXdpAfodvmso9 +5oUdeEhSfeMJLlGIyhHm1CwHMIRfhX62gGsjYkhMFEtjeURl5zY8bNZbLnvqZ3Uj5O9 6Fis98lO3Ro43GhBsmi2MWwq12ZB9gW2rIXlNhv/8oF2JTMLdHPxMmBgx6VlUkV+xwUA Ac7romnrafDMqoOUUDqrmRTzRV+O5eTJRRcSp+j5uZkL51uAiDfdfB13zrGicyiqCJgj no9g== X-Gm-Message-State: AOAM533AV1fW7yKE02sHfrWrTP4EiFs5T4S5IyI+z8iUpI9WYHJsdN4/ x5wSgzhw2hbQ5pF4NOjNntzYSukp5aFgWLDFyfkk67M= X-Google-Smtp-Source: ABdhPJzV7vcRYH85wXzDHBq/VkJMunii009bqAyXQ92QhipuvNrU9usL3hQ3lgLscm9Xe+/Ek8Tsa4EnoYNDq5vMAmM= X-Received: by 2002:a54:450d:: with SMTP id l13mr70663oil.106.1611547175027; Sun, 24 Jan 2021 19:59:35 -0800 (PST) MIME-Version: 1.0 References: <41485ac7-50cf-08fe-4206-b9f863c4d2f5@web.de> <20210124143420.443qexv5dvgtqpbm@first.in-berlin.de> <20210124160729.iybuih6mmaquulcw@first.in-berlin.de> In-Reply-To: From: Yawar Amin Date: Sun, 24 Jan 2021 22:59:24 -0500 Message-ID: To: Ocaml Mailing List Content-Type: multipart/alternative; boundary="000000000000e807c105b9b190af" Subject: Re: [Caml-list] Detecting missed checks for error indications in ML code Reply-To: Yawar Amin X-Loop: caml-list@inria.fr X-Sequence: 18386 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: --000000000000e807c105b9b190af Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jan 24, 2021 at 11:22 AM Markus Elfring wrote: > ... > Are you used to programming concerns according to software weaknesses > like =E2=80=9CCWE-252: Unchecked Return Value=E2=80=9D? > https://cwe.mitre.org/data/definitions/252.html I would say this is a solved problem. Or at least, it can be if you program in that way, using the result type to indicate errors. Even better, using polymorphic variants to encode the different types of errors. But you are already aware of this approach, since you linked to Vladimir Keleshev's article on it. Actually, this was a solved problem even before the result type was introduced into OCaml, because we already had exceptions. And exceptions were invented exactly for the purpose of ensuring that errors can never go unnoticed. In other words, an exception ensures that either you handle it, or the program crashes. Of course, someone could just do a try...catch and ignore exceptions. But at that point, no one can help them. Regards, Yawar --000000000000e807c105b9b190af Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Jan 24, 2021 at 11:22 AM Mark= us Elfring <Markus.Elfring@web.= de> wrote:
https://cwe.mitre.org/data/definitions/252.html

I would say this is a solved problem. Or at = least, it can be if you program in that way, using the result type to indic= ate errors. Even better, using polymorphic variants to encode the different= types of errors. But you are already aware of this approach, since you lin= ked to Vladimir Keleshev's article on it.

Actu= ally, this was a solved problem even before the result type was introduced = into OCaml, because we already had exceptions. And exceptions were invented= exactly for the purpose of ensuring that errors can never go unnoticed. In= other words, an exception ensures that either you handle it, or the progra= m crashes.

Of course, someone could just do a try.= ..catch and ignore exceptions. But at that point, no one can help them.

Regards,

Yawar
--000000000000e807c105b9b190af--