Function Macro

GLibGNUC_SCANF

Declaration [src]

#define G_GNUC_SCANF (
  format_idx,
  arg_idx
)

Description [src]

Expands to the GNU C format function attribute if the compiler is gcc. This is used for declaring functions which take a variable number of arguments, with the same syntax as scanf(). It allows the compiler to type-check the arguments passed to the function.

int my_scanf (MyStream *stream,
              const char *format,
              ...) G_GNUC_SCANF (2, 3);
int my_vscanf (MyStream *stream,
               const char *format,
               va_list ap) G_GNUC_SCANF (2, 0);

See the GNU C documentation for details.

This function is not directly available to language bindings.

Parameters

format_idx

Type: -

The index of the argument corresponding to the format string (the arguments are numbered from 1).

arg_idx

Type: -

The index of the first of the format arguments, or 0 if there are no format arguments.