public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Sean" <sean.brogan@microsoft.com>
To: vit9696 <vit9696@protonmail.com>,devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v3 0/1] Add PCD to disable safe string constraint assertions
Date: Mon, 06 Jan 2020 14:54:29 -0800	[thread overview]
Message-ID: <9745.1578351269596692353@groups.io> (raw)
In-Reply-To: <B003EFCC-6748-4B2D-93F5-D438530D6112@protonmail.com>

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

On Mon, Jan 6, 2020 at 10:43 AM, Vitaly Cheptsov wrote:

> 
> My original suggestion was to remove the assertions entirely, but several
> people here said that they use them to verify usage errors when handling
> trusted data. This makes good sense to me, so we suggest to support both
> cases by introducing a PCD in this patch.

I strongly agree with Vitaly.
These asserts cause more trouble than help.  The asserts cause the caller to implement the same checks as the functions and thus make the functional checks useless overhead and complicate the calling code.  These functions are in a base library used in hundreds of unique places and thus should not make assumptions about how to handle errors.  Since they have the ability to and must return error codes (since asserts are generally off in production) this code should rely on the caller to handle the error appropriately.

thanks
Sean

[-- Attachment #2: Type: text/html, Size: 977 bytes --]

  reply	other threads:[~2020-01-06 22:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03 17:12 [PATCH v3 0/1] Add PCD to disable safe string constraint assertions Vitaly Cheptsov
2020-01-03 17:12 ` [PATCH v3 1/1] MdePkg: " Vitaly Cheptsov
2020-01-06 18:28 ` [edk2-devel] [PATCH v3 0/1] " Michael D Kinney
2020-01-06 18:43   ` Vitaly Cheptsov
2020-01-06 22:54     ` Sean [this message]
2020-01-08 16:35     ` Michael D Kinney
2020-01-27  9:47       ` Vitaly Cheptsov
2020-02-10 11:12         ` Vitaly Cheptsov
2020-02-14 11:54           ` Vitaly Cheptsov
2020-02-14 17:00             ` Michael D Kinney
2020-02-14 17:37               ` Vitaly Cheptsov
2020-02-14 22:50                 ` Michael D Kinney
2020-02-14 23:04                   ` Vitaly Cheptsov
2020-02-15  0:02                   ` Andrew Fish
2020-02-15  3:31                     ` Vitaly Cheptsov
2020-02-15  6:26                       ` Andrew Fish
2020-02-15 11:53                         ` Vitaly Cheptsov
2020-02-15 12:02                           ` Vitaly Cheptsov
2020-02-15 19:38                         ` Michael D Kinney
2020-02-16 21:25                           ` Andrew Fish
2020-02-17  6:55                             ` Vitaly Cheptsov
2020-02-17  8:26                             ` Marvin Häuser
2020-02-19 23:55                               ` Andrew Fish
2020-02-20 10:18                                 ` Marvin Häuser
2020-03-03 19:38                                   ` Marvin Häuser
2020-03-04  0:19                                     ` Liming Gao
2020-03-03 20:27                                   ` Andrew Fish
     [not found]                             ` <15F4232304E080CF.5373@groups.io>
2020-02-17  9:36                               ` Marvin Häuser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9745.1578351269596692353@groups.io \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox