public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Long, Qin" <qin.long@intel.com>
To: Laszlo Ersek <lersek@redhat.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	Gerd Hoffmann <kraxel@redhat.com>
Cc: "Ye, Ting" <ting.ye@intel.com>,
	"ronald.cron@arm.com" <ronald.cron@arm.com>,
	"Wu, Jiaxin" <jiaxin.wu@intel.com>,
	"glin@suse.com" <glin@suse.com>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH v2 07/11] CryptoPkg: Clean-up CRT Library Wrapper.
Date: Fri, 31 Mar 2017 02:06:43 +0000	[thread overview]
Message-ID: <BF2CCE9263284D428840004653A28B6E53F7E948@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <e3ec4d81-3d9c-be5d-eaf4-d2893d0ee622@redhat.com>

Laszlo,

Thanks for catching this.

I was using GCC5 toolchain for few validations, the build looks OK. 
Yes, should have more toolchain validations. :-(

I am also confused about this nonull warning.  Maybe strncasecmp function 
could have been defined as the different prototype (explicitely or implicitely):
	int strcasecmp(const char *s1, const char *s2) __attribute__((nonnull));

And there was also one extra build warning (on openssl source) under GCC48.

Let me dig more and provide possible fixes to address this later.


Best Regards & Thanks,
LONG, Qin


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Laszlo Ersek
> Sent: Friday, March 31, 2017 1:34 AM
> To: Long, Qin; edk2-devel@lists.01.org; Gerd Hoffmann
> Cc: Ye, Ting; ronald.cron@arm.com; Wu, Jiaxin; glin@suse.com;
> ard.biesheuvel@linaro.org
> Subject: Re: [edk2] [PATCH v2 07/11] CryptoPkg: Clean-up CRT Library
> Wrapper.
> 
> Qin,
> 
> this patch (commit fc9fa685d689c) seems to break *some* GCC builds:
> 
> On 03/23/17 14:19, Qin Long wrote:
> 
> [snip]
> 
> > +/* Compare first n bytes of string s1 with string s2, ignoring case
> > +*/ int strncasecmp (const char *s1, const char *s2, size_t n) {
> > +  int Val;
> > +
> > +  ASSERT(s1 != NULL);
> > +  ASSERT(s2 != NULL);
> 
> Here. The error messages are:
> 
>   CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c: In function
> 'strncasecmp':
>   MdePkg/Include/Library/DebugLib.h:292:12: error: nonnull argument 's1'
> compared to NULL [-Werror=nonnull-compare]
>            if (!(Expression)) {        \
>             ^
>   CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c:144:3: note: in
> expansion of macro 'ASSERT'
>      ASSERT(s1 != NULL);
>      ^~~~~~
>   MdePkg/Include/Library/DebugLib.h:292:12: error: nonnull argument 's2'
> compared to NULL [-Werror=nonnull-compare]
>            if (!(Expression)) {        \
>               ^
>   CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c:145:3: note: in
> expansion of macro 'ASSERT'
>      ASSERT(s2 != NULL);
>      ^~~~~~
> 
> The GCC documentation <https://gcc.gnu.org/onlinedocs/gcc/Warning-
> Options.html> says,
> 
>   -Wnonnull-compare
> 
>       Warn when comparing an argument marked with the nonnull function
> attribute against null inside the function.
> 
>       -Wnonnull-compare is included in -Wall. It can be disabled with the -Wno-
> nonnull-compare option.
> 
> I have no idea where the compiler thinks "s1" and "s2" are marked as non-
> null. I grepped the tree for "nonnull" and there are no  hits.
> 
> Gerd, what compiler are you using? (From your logs, it looks like OVMF is
> being built for IA32, with the GCC49 tool chain settings.)
> 
> Thanks
> Laszlo
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2017-03-31  2:06 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 13:19 [PATCH v2 00/11] Upgrade CryptoPkg to use the OpenSSL 1.1.0xx/stable release Qin Long
2017-03-23 13:19 ` [PATCH v2 01/11] CryptoPkg/OpensslLib: Update INF files to support OpenSSL-1.1.0x build Qin Long
2017-03-23 18:27   ` Laszlo Ersek
2017-03-27  9:40   ` Gary Lin
2017-03-23 13:19 ` [PATCH v2 02/11] CryptoPkg: Update .gitignore for OpenSSL source masking Qin Long
2017-03-23 18:28   ` Laszlo Ersek
2017-03-23 13:19 ` [PATCH v2 03/11] CryptoPkg/OpensslLib: Remove patch file and installation scripts Qin Long
2017-03-23 18:28   ` Laszlo Ersek
2017-03-23 13:19 ` [PATCH v2 04/11] CryptoPkg/OpensslLib: Add new Perl script for file list generation Qin Long
2017-03-23 18:29   ` Laszlo Ersek
2017-03-23 13:19 ` [PATCH v2 05/11] CryptoPkg/OpensslLib: Add new OpenSSL-HOWTO document Qin Long
2017-03-23 18:31   ` Laszlo Ersek
2017-03-27  9:58   ` Gary Lin
2017-03-23 13:19 ` [PATCH v2 06/11] CryptoPkg: Fix handling of &strcmp function pointers Qin Long
2017-03-23 18:33   ` Laszlo Ersek
2017-03-27  9:41   ` Gary Lin
2017-03-23 13:19 ` [PATCH v2 07/11] CryptoPkg: Clean-up CRT Library Wrapper Qin Long
2017-03-23 18:34   ` Laszlo Ersek
2017-03-27  9:42   ` Gary Lin
2017-03-30 17:33   ` Laszlo Ersek
2017-03-31  2:06     ` Long, Qin [this message]
2017-03-23 13:19 ` [PATCH v2 08/11] CryptoPkg: Add extra build option to disable VS build warning Qin Long
2017-03-23 13:19 ` [PATCH v2 09/11] CryptoPkg: Update HMAC Wrapper with opaque HMAC_CTX object Qin Long
2017-03-23 18:37   ` Laszlo Ersek
2017-03-27  9:56     ` Gary Lin
2017-03-23 13:19 ` [PATCH v2 10/11] CryptoPkg: Update PK Cipher Wrappers work with opaque objects Qin Long
2017-03-23 18:38   ` Laszlo Ersek
2017-03-27  9:44   ` Gary Lin
2017-03-23 13:19 ` [PATCH v2 11/11] CryptoPkg/TlsLib: Update TLS Wrapper to align with OpenSSL changes Qin Long
2017-03-23 16:23   ` Palmer, Thomas
2017-03-24  5:40   ` Wu, Jiaxin
2017-03-23 17:28 ` [PATCH v2 00/11] Upgrade CryptoPkg to use the OpenSSL 1.1.0xx/stable release Laszlo Ersek
2017-03-28  8:19 ` Ye, Ting

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=BF2CCE9263284D428840004653A28B6E53F7E948@SHSMSX103.ccr.corp.intel.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