public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: rebecca@bsdio.com
To: devel@edk2.groups.io, vit9696@protonmail.com, "Kinney,
	Michael D" <michael.d.kinney@intel.com>,
	"lersek@redhat.com" <lersek@redhat.com>
Cc: "leif.lindholm@linaro.org" <leif.lindholm@linaro.org>,
	"afish@apple.com" <afish@apple.com>
Subject: Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add STATIC_ASSERT macro
Date: Fri, 16 Aug 2019 16:23:11 -0600	[thread overview]
Message-ID: <257c1931-3a3e-7e0e-3c3a-40947290588d@bsdio.com> (raw)
In-Reply-To: <Zr6nNTB45m5GQDQNtdSF0GYLNASh_hZ38DlJ7gSamUg27UCRpGVr9O9qH8kMBUS8rRLcsSB63-TIcQuWZWYofilMeuZymMIDS0vi1ZGg9sc=@protonmail.com>

On 2019-08-16 15:40, Vitaly Cheptsov via Groups.Io wrote:
> I missed your message while writing mine, but I am afraid I disagree
> with the functional macro usage for this feature.
>
> I explicitly quoted C standard static_assert definition in one of my
> previous messages, and I want EDK II to be as close to standard C as
> possible.
>

Choosing a random message in this thread to comment.

We could also migrate the existing uses of __STATIC_ASSERT in BaseTools
to the new STATIC_ASSERT:


BaseTools/Source/C/Common/PcdValueCommon.h:22:#define __STATIC_ASSERT
static_assert
BaseTools/Source/C/Common/PcdValueCommon.h:24:#define __STATIC_ASSERT
_Static_assert
Binary file BaseTools/Source/Python/Workspace/DscBuildData.pyc matches
BaseTools/Source/Python/Workspace/DscBuildData.py:2037:                       
CApp = CApp + '__STATIC_ASSERT(sizeof(%s_%s_INIT_Value) < %d *
sizeof(%s), "Pcd %s.%s Value in Dec exceed the array capability %s"); //
From  %s Line %s \n ' % (Pcd.TokenSpaceGuidCName,
Pcd.TokenCName,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName,
Pcd.TokenCName,Pcd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValueFromDecInfo[1])
BaseTools/Source/Python/Workspace/DscBuildData.py:2042:                       
CApp = CApp + '__STATIC_ASSERT(%d < %d * sizeof(%s), "Pcd %s.%s Value in
Dec exceed the array capability %s"); // From %s Line %s \n' %
(ValueSize,pcdarraysize,Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName,
Pcd.TokenCName,Pcd.DatumType,Pcd.DefaultValueFromDecInfo[0],Pcd.DefaultValueFromDecInfo[1])
....


-- 
Rebecca Cran


  reply	other threads:[~2019-08-16 22:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13  8:16 [PATCH v2 0/1] MdePkg: Add STATIC_ASSERT macro vit9696
2019-08-13  8:16 ` [PATCH v2 1/1] " vit9696
2019-08-14 13:50   ` [edk2-devel] " Liming Gao
2019-08-14 15:47     ` Michael D Kinney
2019-08-14 16:22       ` Vitaly Cheptosv
2019-08-15  1:05         ` Yao, Jiewen
2019-08-15  1:59           ` Liming Gao
2019-08-15  2:22             ` Vitaly Cheptosv
2019-08-15  7:36               ` Yao, Jiewen
2019-08-16 16:33             ` Laszlo Ersek
2019-08-16 17:23               ` Vitaly Cheptsov
2019-08-16 19:38                 ` Laszlo Ersek
2019-08-16 20:19                   ` Laszlo Ersek
2019-08-16 21:04                   ` Michael D Kinney
2019-08-16 21:40                     ` Vitaly Cheptsov
2019-08-16 22:23                       ` rebecca [this message]
2019-08-16 22:58                       ` Andrew Fish
2019-08-16 23:34                         ` Vitaly Cheptsov
2019-08-17  0:01                         ` rebecca
2019-08-17  0:03                           ` Andrew Fish
2019-08-17  0:09                             ` rebecca
     [not found]                             ` <15BB8D3E51450F1C.5853@groups.io>
2019-08-21 21:41                               ` rebecca
2019-08-16 21:32                   ` Vitaly Cheptsov
2019-08-16 16:28         ` Laszlo Ersek
2019-08-15 16:08   ` Michael D Kinney
2019-08-16 19:40     ` Laszlo Ersek

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=257c1931-3a3e-7e0e-3c3a-40947290588d@bsdio.com \
    --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