All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
To: Jeff Kirsher <jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	Mark Rustad
	<mark.d.rustad-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] efi: Resolve some shadow warnings
Date: Sat, 6 Sep 2014 10:03:31 +0100	[thread overview]
Message-ID: <20140906090331.GQ3001@console-pimps.org> (raw)
In-Reply-To: <1409967292-31441-1-git-send-email-jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

On Fri, 05 Sep, at 06:34:52PM, Jeff Kirsher wrote:
> From: Mark Rustad <mark.d.rustad-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 
> It is a really bad idea to declare variables or parameters that
> have the same name as common types. It is valid C, but it gets
> surprising if a macro expansion attempts to declare an inner
> local with that type. Change the local names to eliminate the
> hazard.
 
Oops, good catch. Could you include a copy of the compiler shadow
warnings in the commit log? I'm guessing this bug is highlighted with
-Wshadow? How did you discover this problem?

> Change s16 => ps16, s8 => ps8.
 
Hmm... Instead, could you change it to str16 and str8? s8/s16 were
clearly misguided names in the first place, and it's not immediatealy
obvious to me that a 'ps16' would represent "pointer to 16-bit string".

-- 
Matt Fleming, Intel Open Source Technology Center

WARNING: multiple messages have this Message-ID (diff)
From: Matt Fleming <matt@console-pimps.org>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: matt.fleming@intel.com, Mark Rustad <mark.d.rustad@intel.com>,
	linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] efi: Resolve some shadow warnings
Date: Sat, 6 Sep 2014 10:03:31 +0100	[thread overview]
Message-ID: <20140906090331.GQ3001@console-pimps.org> (raw)
In-Reply-To: <1409967292-31441-1-git-send-email-jeffrey.t.kirsher@intel.com>

On Fri, 05 Sep, at 06:34:52PM, Jeff Kirsher wrote:
> From: Mark Rustad <mark.d.rustad@intel.com>
> 
> It is a really bad idea to declare variables or parameters that
> have the same name as common types. It is valid C, but it gets
> surprising if a macro expansion attempts to declare an inner
> local with that type. Change the local names to eliminate the
> hazard.
 
Oops, good catch. Could you include a copy of the compiler shadow
warnings in the commit log? I'm guessing this bug is highlighted with
-Wshadow? How did you discover this problem?

> Change s16 => ps16, s8 => ps8.
 
Hmm... Instead, could you change it to str16 and str8? s8/s16 were
clearly misguided names in the first place, and it's not immediatealy
obvious to me that a 'ps16' would represent "pointer to 16-bit string".

-- 
Matt Fleming, Intel Open Source Technology Center

  parent reply	other threads:[~2014-09-06  9:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-06  1:34 [PATCH] efi: Resolve some shadow warnings Jeff Kirsher
2014-09-06  1:34 ` Jeff Kirsher
     [not found] ` <1409967292-31441-1-git-send-email-jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-09-06  9:03   ` Matt Fleming [this message]
2014-09-06  9:03     ` Matt Fleming
     [not found]     ` <20140906090331.GQ3001-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-09-06  9:15       ` Jeff Kirsher
2014-09-06  9:15         ` Jeff Kirsher

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-all 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=20140906090331.GQ3001@console-pimps.org \
    --to=matt-hnk1s37rvnbexh+ff434mdi2o/jbrioy@public.gmane.org \
    --cc=jeffrey.t.kirsher-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.d.rustad-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.