From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73040 invoked by alias); 27 May 2015 01:03:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 73030 invoked by uid 89); 27 May 2015 01:03:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: emea01-db3-obe.outbound.protection.outlook.com Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=cmetcalf@ezchip.com; Message-ID: <556517D6.4040607@ezchip.com> Date: Wed, 27 May 2015 09:07:00 -0000 From: Chris Metcalf User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Carlos O'Donell , Adhemerval Zanella , GNU C Library Subject: Re: [PATCH] tile: use better variable naming in INLINE_SYSCALL References: <1432664355-10269-1-git-send-email-cmetcalf@ezchip.com> <5564DB29.7020109@redhat.com> In-Reply-To: <5564DB29.7020109@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BN3PR0401CA0025.namprd04.prod.outlook.com (25.162.159.163) To HE1PR02MB0777.eurprd02.prod.outlook.com (25.161.118.141) X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR02MB0777; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:HE1PR02MB0777;BCL:0;PCL:0;RULEID:;SRVR:HE1PR02MB0777; X-Forefront-PRVS: 05891FB07F X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(6009001)(199003)(479174004)(377454003)(52034003)(51704005)(189002)(52604005)(24454002)(19580395003)(50466002)(65956001)(83506001)(86362001)(87976001)(80316001)(65806001)(64706001)(66066001)(46102003)(47776003)(64126003)(5001830100001)(59896002)(117156001)(5001860100001)(62966003)(101416001)(77156002)(107886002)(5001960100002)(92566002)(65816999)(106356001)(15975445007)(77096005)(68736005)(50986999)(87266999)(54356999)(76176999)(2950100001)(42186005)(81156007)(33656002)(5001770100001)(4001350100001)(97736004)(99136001)(23746002)(36756003)(122386002)(40100003)(105586002)(4001540100001)(189998001)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR02MB0777;H:[192.168.1.163];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: ezchip.com does not designate permitted sender hosts) X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2015 01:03:27.7824 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR02MB0777 X-SW-Source: 2015-05/txt/msg00696.txt.bz2 On 5/26/2015 4:44 PM, Carlos O'Donell wrote: > On 05/26/2015 02:19 PM, Chris Metcalf wrote: >> At issue for INLINE_SYSCALL was that it used "err" and "val" >> as variable names in a #define, so that if it was used in a context >> where the "caller" was also using "err" or "val", and those >> variables were passed in to INLINE_SYSCALL, we would end up >> referencing the internal shadowed variables instead. >> >> For example, "char val" in check_may_shrink_heap() in >> sysdeps/unix/sysv/linux/malloc-sysdep.h was being shadowed by >> the syscall return "val" in INLINE_SYSCALL, causing the "char val" >> not to get updated at all, and may_shrink_heap ended up always false. >> >> A similar fix was made to INTERNAL_VSYSCALL_CALL. > Established practice appears to be to use `sc_err`. > > A quick look shows that other sysdep.h also suffer this problem, > but have been lucky that nobody uses `sc_ret` or similarly named > variables in the outer scope. > > Doesn't this also impact MIPS, Microblaze, SPARC and NIOS2? > > sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h: ({ INTERNAL_SYSCALL_DECL(err); \ > sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h:#undef INTERNAL_SYSCALL_DECL > sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h: ({ INTERNAL_SYSCALL_DECL(err); \ > sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h:#undef INTERNAL_SYSCALL_DECL > sysdeps/unix/sysv/linux/mips/mips32/sysdep.h: ({ INTERNAL_SYSCALL_DECL(err); \ > sysdeps/unix/sysv/linux/mips/mips32/sysdep.h:#undef INTERNAL_SYSCALL_DECL > sysdeps/unix/sysv/linux/microblaze/sysdep.h:({ INTERNAL_SYSCALL_DECL(err); \ > sysdeps/unix/sysv/linux/microblaze/sysdep.h:# undef INTERNAL_SYSCALL_DECL > sysdeps/unix/sysv/linux/sparc/sysdep.h:({ INTERNAL_SYSCALL_DECL(err); \ > sysdeps/unix/sysv/linux/sparc/sysdep.h:#undef INTERNAL_SYSCALL_DECL > sysdeps/unix/sysv/linux/nios2/sysdep.h: ({ INTERNAL_SYSCALL_DECL(err); \ > sysdeps/unix/sysv/linux/nios2/sysdep.h:#undef INTERNAL_SYSCALL_DECL > > I dislike the use of `sc_err`, and I'd rather blanket fix > *every* port to use `_sc_err` instead, but that's just me. > > Fixing tile is more than good enough. Thanks for looking at this, and you're right that probably fixing everything is a better approach, but one that I was too lazy to undertake this minute. :-) I updated my change to use _sc_err instead of _sys_err (likewise for _sc_val) and committed. This is the convention already used in sysdeps/unix/alpha/sysdep.h, by the way. -- Chris Metcalf, EZChip Semiconductor http://www.ezchip.com