1 /* PSPP - computes sample statistics.
2 Copyright (C) 2006 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 /* GNU C allows the programmer to declare that certain functions take
23 printf-like arguments, never return, etc. Conditionalize these
24 declarations on whether gcc is in use. */
26 #define ATTRIBUTE(X) __attribute__ (X)
28 /* Only necessary because of a wart in gnulib's xalloc.h. */
29 #define __attribute__(X) __attribute__ (X)
34 /* Marks a function argument as possibly not used. */
35 #define UNUSED ATTRIBUTE ((unused))
37 /* Marks a function that will never return. */
38 #define NO_RETURN ATTRIBUTE ((noreturn))
40 /* Mark a function as taking a printf- or scanf-like format
41 string as its FMT'th argument and that the FIRST'th argument
42 is the first one to be checked against the format string. */
43 #define PRINTF_FORMAT(FMT, FIRST) ATTRIBUTE ((format (__printf__, FMT, FIRST)))
44 #define SCANF_FORMAT(FMT, FIRST) ATTRIBUTE ((format (__scanf__, FMT, FIRST)))
46 /* Tells the compiler that a function may be treated as if any
47 non-`NULL' pointer it returns cannot alias any other pointer
48 valid when the function returns. */
50 #define MALLOC_LIKE ATTRIBUTE ((malloc))
55 /* This attribute was added in GCC 4.0. */
57 #define WARN_UNUSED_RESULT ATTRIBUTE ((warn_unused_result))
59 #define WARN_UNUSED_RESULT
62 /* This attribute indicates that the function does not examine
63 any values except its arguments, and has no effects except the
64 return value. A function that has pointer arguments and
65 examines the data pointed to must _not_ be declared
67 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)
68 #define CONST_FUNCTION ATTRIBUTE ((const))
70 #define CONST_FUNCTION
73 /* This attribute indicates that the function has no effects
74 except the return value and its return value depends only on
75 the parameters and/or global variables. */
77 #define PURE_FUNCTION ATTRIBUTE ((pure))
82 #endif /* compiler.h */