214 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute) for more details.
215 */
216
217/**
218 * G_GNUC_MALLOC:
219 *
220 * Expands to the
221 * [GNU C `malloc` function attribute](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-functions-that-behave-like-malloc)
222 * if the compiler is gcc.
223 * Declaring a function as `malloc` enables better optimization of the function,
224 * but must only be done if the allocation behaviour of the function is fully
225 * understood, otherwise miscompilation can result.
226 *
227 * A function can have the `malloc` attribute if it returns a pointer which is
228 * guaranteed to not alias with any other pointer valid when the function
229 * returns, and moreover no pointers to valid objects occur in any storage
230 * addressed by the returned pointer.
231 *
232 * In practice, this means that `G_GNUC_MALLOC` can be used with any function
233 * which returns unallocated or zeroed-out memory, but not with functions which
234 * return initialised structures containing other pointers, or with functions
235 * that reallocate memory. This definition changed in GLib 2.58 to match the
236 * stricter definition introduced around GCC 5.
237 *
238 * Place the attribute after the declaration, just before the semicolon.
307 * Expands to the GNU C `sentinel` function attribute if the compiler is gcc.
308 * This function attribute only applies to variadic functions and instructs
309 * the compiler to check that the argument list is terminated with an
310 * explicit %NULL.
311 *
312 * Place the attribute after the declaration, just before the semicolon.
313 *
314 * |[<!-- language="C" -->
315 * gchar *g_strconcat (const gchar *string1,
316 * ...) G_GNUC_NULL_TERMINATED;
317 * ]|
318 *
319 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-sentinel-function-attribute) for more details.
373 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alloc_005fsize-function-attribute) for more details.
374 *
375 * Since: 2.18
376 */
377
378/**
379 * G_GNUC_ALLOC_SIZE2:
380 * @x: the index of the argument specifying one factor of the allocation size
381 * @y: the index of the argument specifying the second factor of the allocation size
382 *
383 * Expands to the GNU C `alloc_size` function attribute if the compiler is a
384 * new enough gcc. This attribute tells the compiler that the function returns
385 * a pointer to memory of a size that is specified by the product of two
386 * function parameters.
387 *
388 * Place the attribute after the function declaration, just before the
396 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alloc_005fsize-function-attribute) for more details.
509 * Expands to the GNU C `noreturn` function attribute if the compiler is gcc.
510 * It is used for declaring functions which never return. It enables
511 * optimization of the function, and avoids possible compiler warnings.
512 *
513 * Since 2.68, it is recommended that code uses %G_NORETURN instead of
514 * %G_GNUC_NORETURN, as that works on more platforms and compilers (in
515 * particular, MSVC and C++11) than %G_GNUC_NORETURN, which works with GCC and
516 * Clang only. %G_GNUC_NORETURN continues to work, so has not been deprecated
517 * yet.
518 *
519 * Place the attribute after the declaration, just before the semicolon.
520 *
521 * |[<!-- language="C" -->
522 * void g_abort (void) G_GNUC_NORETURN;
523 * ]|
524 *
525 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noreturn-function-attribute) for more details.
526 */
527
528/**
529 * G_GNUC_CONST:
530 *
531 * Expands to the GNU C `const` function attribute if the compiler is gcc.
532 * Declaring a function as `const` enables better optimization of calls to
533 * the function. A `const` function doesn't examine any values except its
534 * parameters, and has no effects except its return value.
535 *
536 * Place the attribute after the declaration, just before the semicolon.
537 *
538 * |[<!-- language="C" -->
539 * gchar g_ascii_tolower (gchar c) G_GNUC_CONST;
540 * ]|
541 *
542 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute) for more details.
543 *
544 * A function that has pointer arguments and examines the data pointed to
545 * must not be declared `const`. Likewise, a function that calls a non-`const`
546 * function usually must not be `const`. It doesn't make sense for a `const`
547 * function to return `void`.
548 */
549
550/**
551 * G_GNUC_UNUSED:
552 *
553 * Expands to the GNU C `unused` function attribute if the compiler is gcc.
554 * It is used for declaring functions and arguments which may never be used.
555 * It avoids possible compiler warnings.
556 *
557 * For functions, place the attribute after the declaration, just before the
558 * semicolon. For arguments, place the attribute at the beginning of the
566 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-unused-function-attribute) for more details.
567 */
568
569/**
570 * G_GNUC_NO_INSTRUMENT:
571 *
572 * Expands to the GNU C `no_instrument_function` function attribute if the
573 * compiler is gcc. Functions with this attribute will not be instrumented
574 * for profiling, when the compiler is called with the
575 * `-finstrument-functions` option.
576 *
577 * Place the attribute after the declaration, just before the semicolon.
578 *
579 * |[<!-- language="C" -->
580 * int do_uninteresting_things (void) G_GNUC_NO_INSTRUMENT;
581 * ]|
582 *
583 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005finstrument_005ffunction-function-attribute) for more details.
657 * Expands to the GNU C `fallthrough` statement attribute if the compiler supports it.
658 * This allows declaring case statement to explicitly fall through in switch
659 * statements. To enable this feature, use `-Wimplicit-fallthrough` during
660 * compilation.
661 *
662 * Put the attribute right before the case statement you want to fall through
663 * to.
664 *
665 * |[<!-- language="C" -->
666 * switch (foo)
667 * {
668 * case 1:
669 * g_message ("it's 1");
670 * G_GNUC_FALLTHROUGH;
671 * case 2:
672 * g_message ("it's either 1 or 2");
673 * break;
674 * }
675 * ]|
676 *
677 *
678 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#index-fallthrough-statement-attribute) for more details.
693 * Expands to the GNU C `deprecated` attribute if the compiler is gcc.
694 * It can be used to mark `typedef`s, variables and functions as deprecated.
695 * When called with the `-Wdeprecated-declarations` option,
696 * gcc will generate warnings when deprecated interfaces are used.
697 *
698 * Place the attribute after the declaration, just before the semicolon.
699 *
700 * |[<!-- language="C" -->
701 * int my_mistake (void) G_GNUC_DEPRECATED;
702 * ]|
703 *
704 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-deprecated-function-attribute) for more details.
716 * @f: the intended replacement for the deprecated symbol,
717 * such as the name of a function
718 *
719 * Like %G_GNUC_DEPRECATED, but names the intended replacement for the
720 * deprecated symbol if the version of gcc in use is new enough to support
721 * custom deprecation messages.
722 *
723 * Place the attribute after the declaration, just before the semicolon.
724 *
725 * |[<!-- language="C" -->
726 * int my_mistake (void) G_GNUC_DEPRECATED_FOR(my_replacement);
727 * ]|
728 *
729 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-deprecated-function-attribute) for more details.
730 *
731 * Note that if @f is a macro, it will be expanded in the warning message.
732 * You can enclose it in quotes to prevent this. (The quotes will show up
733 * in the warning, but it's better than showing the macro expansion.)
796 * Expands to the GNU C `warn_unused_result` function attribute if the compiler
797 * is gcc. This function attribute makes the compiler emit a warning if the
798 * result of a function call is ignored.
799 *
800 * Place the attribute after the declaration, just before the semicolon.
801 *
802 * |[<!-- language="C" -->
803 * GList *g_list_append (GList *list,
804 * gpointer data) G_GNUC_WARN_UNUSED_RESULT;
805 * ]|
806 *
807 * See the [GNU C documentation](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-warn_005funused_005fresult-function-attribute) for more details.