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