Re: Request for compiler option to disable multiple declarations in a single statement

2018-04-19 Thread Eric Gallager
On 4/19/18, Manish Jain wrote: > Hi all, > > One of the historical artefacts of the C language has been the burden of > lugging around multiple declarations in a single statement, with some > well-known pitfalls: > > int* ptr1, ptr2; > > Since ptr2 looks like a pointer but actually is not, standar

Re: Request for compiler option to disable multiple declarations in a single statement

2018-04-19 Thread Jonathan Wakely
Insulting people and insisting your preferred coding style (which is not the one used by GCC's own code, by the way) is definitely a good way to get people interested in your proposal.

Re: Request for compiler option to disable multiple declarations in a single statement

2018-04-19 Thread Manish Jain
> Wars have been fought over less. I joined the list to make the request. So I just hope my war is not in a lonely one-man army. >> As for the problem of multiple declarations fraught in the suggestion >> above, I would like gcc developers to please consider a compiler option >> (--single-declar

Re: Request for compiler option to disable multiple declarations in a single statement

2018-04-19 Thread David Brown
On 19/04/18 11:27, Manish Jain wrote: > > On 04/19/18 14:46, David Brown wrote: >> Certainly it is heavily used in existing code - making an option >> to disable it would be impractical. > > Thanks for replying, Mr. Brown. > > What I meant was if an option could be provided, existing code could

Re: Request for compiler option to disable multiple declarations in a single statement

2018-04-19 Thread Manish Jain
On 04/19/18 14:46, David Brown wrote: > Certainly it is heavily used in existing code - making an option > to disable it would be impractical. Thanks for replying, Mr. Brown. What I meant was if an option could be provided, existing code could compile without the option, and fresh code to compi

Re: Request for compiler option to disable multiple declarations in a single statement

2018-04-19 Thread Jonathan Wakely
On 19 April 2018 at 09:09, Manish Jain wrote: > Hi all, > > One of the historical artefacts of the C language has been the burden of > lugging around multiple declarations in a single statement, with some > well-known pitfalls: > > int* ptr1, ptr2; > > Since ptr2 looks like a pointer but actually i

Re: Request for compiler option to disable multiple declarations in a single statement

2018-04-19 Thread David Brown
On 19/04/18 10:09, Manish Jain wrote: > Hi all, > > One of the historical artefacts of the C language has been the burden of > lugging around multiple declarations in a single statement, with some > well-known pitfalls: > > int* ptr1, ptr2; > > Since ptr2 looks like a pointer but actually is n

Request for compiler option to disable multiple declarations in a single statement

2018-04-19 Thread Manish Jain
Hi all, One of the historical artefacts of the C language has been the burden of lugging around multiple declarations in a single statement, with some well-known pitfalls: int* ptr1, ptr2; Since ptr2 looks like a pointer but actually is not, standard coding guidelines recommend declaring like