Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756797AbcJ1XmW (ORCPT ); Fri, 28 Oct 2016 19:42:22 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:35964 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751949AbcJ1XmU (ORCPT ); Fri, 28 Oct 2016 19:42:20 -0400 MIME-Version: 1.0 In-Reply-To: References: <72e07814-56e9-505a-d660-91ff20b6efea@users.sourceforge.net> From: Jim Davis Date: Fri, 28 Oct 2016 16:42:18 -0700 Message-ID: Subject: Re: [PATCH 09/10] scripts/basic/fixdep: Complete error handling in print_cmdline() To: SF Markus Elfring Cc: linux-kbuild@vger.kernel.org, Michal Marek , LKML , kernel-janitors@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 571 Lines: 16 On Fri, Oct 28, 2016 at 1:40 AM, SF Markus Elfring wrote: > + if (printf("cmd_%s := %s\n\n", target, cmdline) < 10) { Rather than scatter fragile magic numbers, like 10, throughout the code, if you're hell-bent on checking for printf errors you could write a little wrapper function that hid the magic number and bundled up the errno stuff. But what would you expect printf error checking to tell a user? Perhaps that he or she ran out of disk space, but that's going to be painfully obvious anyway in almost every case. -- Jim