Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: J. on April 18, 2020, 03:19:05 pm

Title: automatic header guard added despite one is already existing
Post by: J. on April 18, 2020, 03:19:05 pm
Since one of the March 2020 Windows nightly builds - or even earlier -, header guards are automatically added to header files, regardless if there is already one in the header body further down or not.  The example below suggests that the algorithm appears to be checking the first line only (try and open the file, then make a change in the editor ... and there is an obsolete additional header guard).

Code
/** comment */

#ifndef HEADER_H_INCLUDED
#define HEADER_H_INCLUDED

#endif // HEADER_H_INCLUDED

Can this feature be switched-off somewhere, since changing to headers of packages with, e.g., a banner before the header guard always results in unneccessary changes which is pretty annoying? Still observed in Nightly build 2020-04-18.

Thanks!
Title: Re: automatic header guard added despite one is already existing
Post by: Miguel Gimenez on April 18, 2020, 03:50:50 pm
Disable the new header guard plugin
Title: Re: automatic header guard added despite one is already existing
Post by: J. on April 19, 2020, 09:53:17 am
Great - that works!  Happy to switch the plugin on again, when it is able to cope with already existing guards.

Many thanks, Miguel!