This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to disable multiple declarations
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: "sumit kasliwal," <sumitkasliwalin at yahoo dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sat, 19 May 2018 07:11:59 +0100
- Subject: Re: How to disable multiple declarations
- References: <690331560.3047642.1526709674214.ref@mail.yahoo.com> <690331560.3047642.1526709674214@mail.yahoo.com>
On 19 May 2018 at 07:01, sumit kasliwal; wrote:
>> Hi,
>>
>> As a visiting faculty member at a local college, I am preparing
>> documentation for some students that details bad practices to
>> avoid when programming with C.
>>
>> One of the practices I admonish against is multiple declarations
>> in a single statement. While my doc does whatever little is
>> possible at the documentation level, I was also looking for a way
>> for being able to disable multiple declarations in the Makefile
>> itself.
>>
>> Is there some way I can get the gcc compiler to throw an error
>> at compile time if it spots multiple declarations being made
>> in a single C statement ? The error mechanism must be specific
>> to multiple-declarations.
>>
>> Thanks for any help
There was a thread about this recently:
https://gcc.gnu.org/ml/gcc/2018-04/msg00110.html
But the short answer is no.