From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753478AbbCDWSS (ORCPT ); Wed, 4 Mar 2015 17:18:18 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:33507 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752978AbbCDWSQ (ORCPT ); Wed, 4 Mar 2015 17:18:16 -0500 Date: Wed, 4 Mar 2015 14:18:15 -0800 From: Andrew Morton To: Nicolas Iooss Cc: linux-kernel@vger.kernel.org, Mark Brown , David Woodhouse Subject: Re: [PATCH] ihex: restore missing default in switch statement Message-Id: <20150304141815.e740456b5e386c2357f89194@linux-foundation.org> In-Reply-To: <1425479050-5997-1-git-send-email-nicolas.iooss_linux@m4x.org> References: <1425479050-5997-1-git-send-email-nicolas.iooss_linux@m4x.org> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Mar 2015 22:24:10 +0800 Nicolas Iooss wrote: > Commit 2473238eac95 ("ihex: add support for CS:IP/EIP records") removes > the "default:" statement in the switch block, making the "return > usage();" line dead code and ihex2fw silently ignoring unknown options. > Restore this statement. > > This bug was found by building with HOSTCC=clang and adding > -Wunreachable-code-return to HOSTCFLAGS. > > ... > > --- a/firmware/ihex2fw.c > +++ b/firmware/ihex2fw.c > @@ -86,6 +86,7 @@ int main(int argc, char **argv) > case 'j': > include_jump = 1; > break; > + default: > return usage(); > } > } whee. So if there's userspace out there which is passing bad options to ihex2fw, this fix will break it. Oh well, I expect we'll survive.