From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754814AbcCBO3H (ORCPT ); Wed, 2 Mar 2016 09:29:07 -0500 Received: from mail.skyhub.de ([78.46.96.112]:57600 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754085AbcCBO3E (ORCPT ); Wed, 2 Mar 2016 09:29:04 -0500 Date: Wed, 2 Mar 2016 15:28:57 +0100 From: Borislav Petkov To: One Thousand Gnomes Cc: Andy Lutomirski , x86@kernel.org, linux-kernel@vger.kernel.org, Oleg Nesterov , Andrew Cooper , Brian Gerst Subject: Re: [PATCH 01/10] selftests/x86: In syscall_nt, test NT|TF as well Message-ID: <20160302142856.GJ16954@pd.tnic> References: <98d687a7a464ba29ba493f3885f138902c6ac574.1456720860.git.luto@kernel.org> <20160302125952.GG16954@pd.tnic> <20160302140115.578910ee@lxorguk.ukuu.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160302140115.578910ee@lxorguk.ukuu.org.uk> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 02, 2016 at 02:01:15PM +0000, One Thousand Gnomes wrote: > int main(void) is wrong as there are passed arguments Not in this particular case - test doesn't take args. > int main() is ok (in C89 at least) because it means "there are unknown > arguments" > > int main(int argc, char *argv[]) is allowed > > int main(void) is not safe on all platforms because some compilers > choose to do the argument cleanup in the return path of the called > function. Having the wrong number of arguments doesn't end well in such > cases. I doubt any Linux platforms do this but we shouldn't be > encouraging bad programming techniques 8) There's also the variadic thing. Here's hpa's sermon from a couple of years ago: http://thread.gmane.org/gmane.linux.kernel/1268751/focus=1268792 :-)))) -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.