pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/libpspp compiler.h ChangeLog


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/src/libpspp compiler.h ChangeLog
Date: Mon, 31 Jul 2006 22:50:01 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Changes by:     Ben Pfaff <blp> 06/07/31 22:50:01

Modified files:
        src/libpspp    : compiler.h ChangeLog 

Log message:
        New PURE_FUNCTION, CONST_FUNCTION macros.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/libpspp/compiler.h?cvsroot=pspp&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/pspp/src/libpspp/ChangeLog?cvsroot=pspp&r1=1.34&r2=1.35

Patches:
Index: compiler.h
===================================================================
RCS file: /cvsroot/pspp/pspp/src/libpspp/compiler.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- compiler.h  8 May 2006 00:10:21 -0000       1.2
+++ compiler.h  31 Jul 2006 22:50:01 -0000      1.3
@@ -32,12 +32,21 @@
 #define ATTRIBUTE(X)
 #endif
 
+/* Marks a function argument as possibly not used. */
 #define UNUSED ATTRIBUTE ((unused))
+
+/* Marks a function that will never return. */
 #define NO_RETURN ATTRIBUTE ((noreturn))
+
+/* Mark a function as taking a printf- or scanf-like format
+   string as its FMT'th argument and that the FIRST'th argument
+   is the first one to be checked against the format string. */
 #define PRINTF_FORMAT(FMT, FIRST) ATTRIBUTE ((format (printf, FMT, FIRST)))
 #define SCANF_FORMAT(FMT, FIRST) ATTRIBUTE ((format (scanf, FMT, FIRST)))
 
-/* This attribute was added late in the GCC 2.x cycle. */
+/* Tells the compiler that a function may be treated as if any
+   non-`NULL' pointer it returns cannot alias any other pointer
+   valid when the function returns. */
 #if __GNUC__ > 2
 #define MALLOC_LIKE ATTRIBUTE ((malloc))
 #else
@@ -51,4 +60,24 @@
 #define WARN_UNUSED_RESULT
 #endif
 
+/* This attribute indicates that the function does not examine
+   any values except its arguments, and have no effects except
+   the return value.  A function that has pointer arguments and
+   examines the data pointed to must _not_ be declared
+   `const'.  */
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)
+#define CONST_FUNCTION ATTRIBUTE ((const))
+#else
+#define CONST_FUNCTION
+#endif
+
+/* This attribute indicates that the function has no effects
+   except the return value and its return value depends only on
+   the parameters and/or global variables. */
+#if __GNUC__ > 2
+#define PURE_FUNCTION ATTRIBUTE ((pure))
+#else
+#define PURE_FUNCTION
+#endif
+
 #endif /* compiler.h */

Index: ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/libpspp/ChangeLog,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- ChangeLog   18 Jul 2006 04:57:01 -0000      1.34
+++ ChangeLog   31 Jul 2006 22:50:01 -0000      1.35
@@ -1,3 +1,8 @@
+Mon Jul 31 15:49:46 2006  Ben Pfaff  <address@hidden>
+
+       * compiler.h: (macro CONST_FUNCTION) New macro.
+       (macro PURE_FUNCTION) New macro.
+
 Sun Jul 16 21:07:35 2006  Ben Pfaff  <address@hidden>
 
        * message.c: (static int messages_disabled) New variable.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]