lkml.org 
[lkml]   [2018]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] objtool/x86: Replace Non-standard Range Expression in Case
On Fri, Feb 16, 2018 at 08:35:11AM -0600, Josh Poimboeuf wrote:
> On Fri, Feb 16, 2018 at 07:55:13PM +0530, Progyan Bhattacharya wrote:
> > Replace range expressions with seperate individual cases, i.e. convert case 1...3: to case 1: case 2: case 3
> > Range expression within case statements are non-standard C code and can create issues over compiler and platform variety.
> >
> > While compiling with gcc 4.8 (RHEL) I encountered this error on range expression in case statements:
> > error: range expressions in switch statements are non-standard [-Werror=pedantic]
> >
> > Signed-off-by: Progyan Bhattacharya <progyanb@acm.org>
>
> Hi Progyan,
>
> Thank you for the patch.
>
> I think this makes the code unnecessarily verbose and less readable. We
> rely on many such GCC extensions, and we don't aim to comply with
> standard C. And AFAIK, we don't use -Werror=pedantic in the kernel.

Agreed, it makes the code actively worse. Just don't use error=pedantic.

\
 
 \ /
  Last update: 2018-02-16 17:48    [W:2.037 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site