Re: Proposal to add rule for nested CPP Directives in RTEMS coding conventions

2020-04-13 Thread Vijay Kumar Banerjee
On Mon, Apr 13, 2020 at 8:57 PM Joel Sherrill wrote: > First, I appreciate the effort and probably agree with the FreeBSD rule. > Can you post a link? > > https://www.freebsd.org/cgi/man.cgi?query=style&sektion=9 > I'm just not getting the nested rule out of the discussion so far. I can > see a

Re: Proposal to add rule for nested CPP Directives in RTEMS coding conventions

2020-04-13 Thread Joel Sherrill
First, I appreciate the effort and probably agree with the FreeBSD rule. Can you post a link? I'm just not getting the nested rule out of the discussion so far. I can see a sequence like this being covered: #if #elif #else #endif But not this: #if #if #else #endif #endif The latter is ne

Re: Proposal to add rule for nested CPP Directives in RTEMS coding conventions

2020-04-13 Thread Vaibhav Gupta
On Sat, 4 Apr 2020 at 01:44, Vaibhav Gupta wrote: > > > > On Sat, Apr 4, 2020, 1:41 AM Vijay Kumar Banerjee wrote: >> >> >> >> On Sat, Apr 4, 2020 at 1:22 AM Vaibhav Gupta >> wrote: >>> >>> CPP directives like: >>> 1) #if >>> 2) #ifdef >>> 3) #ifndef >>> 4) #elif >>> 5) #else >>> 6) #endif >>>

Re: Proposal to add rule for nested CPP Directives in RTEMS coding conventions

2020-04-03 Thread Vaibhav Gupta
On Sat, Apr 4, 2020, 1:41 AM Vijay Kumar Banerjee wrote: > > > On Sat, Apr 4, 2020 at 1:22 AM Vaibhav Gupta > wrote: > >> CPP directives like: >> 1) #if >> 2) #ifdef >> 3) #ifndef >> 4) #elif >> 5) #else >> 6) #endif >> >> do form code blocks. Since, they don't make use of brackets, >> as a part

Re: Proposal to add rule for nested CPP Directives in RTEMS coding conventions

2020-04-03 Thread Vijay Kumar Banerjee
On Sat, Apr 4, 2020 at 1:22 AM Vaibhav Gupta wrote: > CPP directives like: > 1) #if > 2) #ifdef > 3) #ifndef > 4) #elif > 5) #else > 6) #endif > > do form code blocks. Since, they don't make use of brackets, > as a part of C language rule, their nested and repeated use > can make the code very ha

Proposal to add rule for nested CPP Directives in RTEMS coding conventions

2020-04-03 Thread Vaibhav Gupta
CPP directives like: 1) #if 2) #ifdef 3) #ifndef 4) #elif 5) #else 6) #endif do form code blocks. Since, they don't make use of brackets, as a part of C language rule, their nested and repeated use can make the code very hard to read. Can even result it spaghetti code. This can be understood by t