public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Garrett Cooper <yanegomi@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 2/2] pthread_rwlock_unlock/4-2: remove local var 'rc'
Date: Tue, 13 Dec 2011 14:08:01 +0800	[thread overview]
Message-ID: <4EE6EBC1.3000305@cn.fujitsu.com> (raw)
In-Reply-To: <CAGH67wQKH_iXJ59eDikG89_DzgGAU5n-_Sd9hoFt8devOFOmKg@mail.gmail.com>

On 12/13/2011 01:56 PM, Garrett Cooper wrote:

> On Fri, Dec 9, 2011 at 1:18 AM, Wanlong Gao <gaowanlong@cn.fujitsu.com> wrote:
>> On 12/09/2011 04:28 PM, Kang Kai wrote:
>>
>>> Local var 'rc' in function main hides the global one. In child thread
>>> it sets global var 'rc' with funtion return value. But in function main,
>>> test var 'rc' always succeeds because it tests local var 'rc'.
>>>
>>
>>
>> Good catch.
>>
>> Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
>>
>>> Signed-off-by: Kang Kai <kai.kang@windriver.com>
>>> ---
>>>  .../interfaces/pthread_rwlock_unlock/4-2.c         |    3 +--
>>>  1 files changed, 1 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c
>>> index 3023886..4928f85 100644
>>> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c
>>> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c
>>> @@ -54,7 +54,6 @@ static void* fn_unlk(void *arg)
>>>  int main()
>>>  {
>>>       int cnt = 0;
>>> -     int rc = 0;
>>>
>>>       pthread_t un_thread;
>>>
>>> @@ -125,4 +124,4 @@ int main()
>>>
>>>       printf("Test PASSED: Note*: Returned 0 instead of EPERM, but standard specified _may_ fail.\n");
>>>       return PTS_PASS;
>>> -}
>>> \ No newline at end of file
>>> +}
> 
> Will be committed soon (kind of interesting why -Wshadow didn't
> identify this issue...).


Yeah, odd, I didn't see warning by -Wshadow, either.

> -Garrett
> 



------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and 
improve service delivery. Take 5 minutes to use this Systems Optimization 
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2011-12-13  6:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09  8:28 [LTP] Patches for POSIX test cases Kang Kai
2011-12-09  8:28 ` [LTP] [PATCH 1/2] pthread_mutex_lock/3-1: make sure install signal hanldler first Kang Kai
2011-12-13  6:04   ` Garrett Cooper
2011-12-09  8:28 ` [LTP] [PATCH 2/2] pthread_rwlock_unlock/4-2: remove local var 'rc' Kang Kai
2011-12-09  9:18   ` Wanlong Gao
2011-12-13  5:56     ` Garrett Cooper
2011-12-13  6:08       ` Wanlong Gao [this message]
2011-12-09  8:52 ` [LTP] Patches for POSIX test cases Wanlong Gao
2011-12-09  9:19   ` Kang Kai
2011-12-13  5:52   ` Garrett Cooper
2011-12-09 13:04 ` Cyril Hrubis

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=4EE6EBC1.3000305@cn.fujitsu.com \
    --to=gaowanlong@cn.fujitsu.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=yanegomi@gmail.com \
    /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