29-03-2018, 12:36 PM
The example of Directive 4.10 "Precautions shall be taken in order to prevent the contents of a header file being included more than once" says that in order to facilitate checking, the contents of the header should be protected from being included more than once using one of the following two forms:
I got software from a third party which uses the first form, but the parentheses are a bit differently placed:
As I consider this include guard correct from a functional point of view, is this nevertheless a violation of Dir 4.10 because it does not use one of the two forms listed in the example?
Code:
#if !defined ( identifier )
#define identifier
/* Contents of file */
#endif
#ifndef identifier
#define identifier
/* Contents of file */
#endif
Code:
#if ( !defined identifier )
<t></t>