once C File Option (AIX)

Syntax: Default:
file(once[, yes])
file(once, no)
file(once, no)

This option controls whether to include a header file more than once when it is specified in several of the files you are compiling.

By default, the C compiler includes header files as many times as they are specified in the source files being compiled.

Set file(once) to cause the C compiler to include each header file once only, regardless of the number of times it is specified in the source files.

The compiler uses the full path name to determine if a file has already been included.   No attempt is made to resolve . or .. in the path name.  #include statements that include . or .. in the path statements may cause the same file to be included more than once.

Note: Do not use the  file(once) option if both of the following conditions are true:
  1. You include both stdio.h and stdarg.h (in that order) in your source files.
  2. You are using the macro va_list.

va_list must be defined twice to have any effect, and file(once) defeats this purpose.

The following example shows how the C compiler resolves whether a file has already been included.

#include <stdio.h> 	/* Found in /usr/include/stdio.h 	*/
#include <stdio.h> 	/* Already included 		 	*/
#include </usr/include/stdio.h> /* Already included		*/
#include <./stdio.h> 	/* Resolves to /usr/include/./stdio.h	*/
			/* which is the same file, but this	*/
			/* file will be included again.		*/


C Compilation
Configuration Files


Set Build Options
Build


C File Options