Liming,

GCC can detect redefinition of same type.

--------------------
typedef int foo;
typedef int foo;

int main (int argc, char *argv[]) {
  return 0;
}
--------------------
gcc a.c -Wpedantic -std=c99

a.c:2:13: warning: redefinition of typedef ‘foo’ [-Wpedantic]
 typedef int foo;
             ^~~
a.c:1:13: note: previous declaration of ‘foo’ was here
 typedef int foo;
             ^~~

Mike

> -----Original Message-----
> From: gaoliming <gaolim...@byosoft.com.cn>
> Sent: Tuesday, March 30, 2021 6:20 PM
> To: Kinney, Michael D <michael.d.kin...@intel.com>; devel@edk2.groups.io
> Cc: Liu, Zhiguang <zhiguang....@intel.com>; Yao, Jiewen 
> <jiewen....@intel.com>; Wang, Jian J <jian.j.w...@intel.com>; Lu,
> XiaoyuX <xiaoyux...@intel.com>; Jiang, Guomin <guomin.ji...@intel.com>
> Subject: 回复: [Patch 0/3] Remove duplicate type declarations in MdePkg and 
> CryptoPkg
> 
> Mike:
>  The change is good. Reviewed-by: Liming Gao <gaolim...@byosoft.com.cn>
> 
>  Besides, which compiler option can detect this warning?
> 
> Thanks
> Liming
> > -----邮件原件-----
> > 发件人: Michael D Kinney <michael.d.kin...@intel.com>
> > 发送时间: 2021年3月31日 7:04
> > 收件人: devel@edk2.groups.io
> > 抄送: Liming Gao <gaolim...@byosoft.com.cn>; Zhiguang Liu
> > <zhiguang....@intel.com>; Jiewen Yao <jiewen....@intel.com>; Jian J Wang
> > <jian.j.w...@intel.com>; Xiaoyu Lu <xiaoyux...@intel.com>; Guomin Jiang
> > <guomin.ji...@intel.com>
> > 主题: [Patch 0/3] Remove duplicate type declarations in MdePkg and
> > CryptoPkg
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3287
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3286
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3285
> >
> > Remove duplicate declarations of the following types that may
> > generate compiler warnings or errors:
> > * EFI_HII_POPUP_PROTOCOL
> > * EFI_RESET_NOTIFICATION_PROTOCOL
> > * EDKII_CRYPTO_RSA_GET_PUBLIC_KEY_FROM_X509
> >
> > Cc: Liming Gao <gaolim...@byosoft.com.cn>
> > Cc: Zhiguang Liu <zhiguang....@intel.com>
> > Cc: Jiewen Yao <jiewen....@intel.com>
> > Cc: Jian J Wang <jian.j.w...@intel.com>
> > Cc: Xiaoyu Lu <xiaoyux...@intel.com>
> > Cc: Guomin Jiang <guomin.ji...@intel.com>
> > Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com>
> >
> > Michael D Kinney (3):
> >   MdePkg/Include/Protocol: EFI_HII POPUP_PROTOCOL duplicate declaration
> >   MdePkg/Include/Protocol: EFI_RESET_NOTIFICATION_PROTOCOL duplicate
> >   CryptoPkg/Private/Protocol/Crypto.h: Remove duplicate function type
> >
> >  CryptoPkg/Private/Protocol/Crypto.h         | 28 +--------------------
> >  MdePkg/Include/Protocol/HiiPopup.h          |  6 ++---
> >  MdePkg/Include/Protocol/ResetNotification.h |  6 ++---
> >  3 files changed, 7 insertions(+), 33 deletions(-)
> >
> > --
> > 2.31.1.windows.1
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73560): https://edk2.groups.io/g/devel/message/73560
Mute This Topic: https://groups.io/mt/81741313/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to