You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2012/01/09 14:18:26 UTC

svn commit: r1229139 - in /httpd/httpd/branches/2.4.x: ./ include/ap_config.h include/http_protocol.h include/http_request.h include/httpd.h include/util_cookies.h include/util_filter.h include/util_script.h

Author: sf
Date: Mon Jan  9 13:18:26 2012
New Revision: 1229139

URL: http://svn.apache.org/viewvc?rev=1229139&view=rev
Log:
Merge r1229134, r1229136:

Rename ap_func_attr_* macros to AP_FN_ATTR_*
Add macro for attribute alloc_size on newer gcc's

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/include/ap_config.h
    httpd/httpd/branches/2.4.x/include/http_protocol.h
    httpd/httpd/branches/2.4.x/include/http_request.h
    httpd/httpd/branches/2.4.x/include/httpd.h
    httpd/httpd/branches/2.4.x/include/util_cookies.h
    httpd/httpd/branches/2.4.x/include/util_filter.h
    httpd/httpd/branches/2.4.x/include/util_script.h

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan  9 13:18:26 2012
@@ -1,3 +1,3 @@
 /httpd/httpd/branches/revert-ap-ldap:1150158-1150173
 /httpd/httpd/branches/wombat-integration:723609-723841
-/httpd/httpd/trunk:1201042,1201111,1201194,1201198,1201202,1202236,1202456,1202886,1203859,1204630,1204968,1204990,1205061,1205075,1205379,1205885,1206291,1206587,1206850,1207719,1208753,1208835,1209053,1209085,1209417,1209432,1209461,1209601,1209603,1209618,1209623,1209741,1209754,1209766,1209776,1209797-1209798,1209811-1209812,1209814,1209908,1209910,1209913,1209916-1209917,1209947,1209952,1210080,1210124,1210130,1210219,1210221,1210252,1210284,1210378,1210725,1210892,1210951,1210954,1211528,1211663,1211680,1212883,1213338,1213567,1214003,1214005,1214015,1220462,1220467,1220493,1220524,1220570,1220768,1220794,1220826,1220846,1221292,1222335,1222370,1222473,1222915,1222917,1222921,1223048,1225060,1225197-1225198,1225380,1225476,1225478,1225791,1225795-1225796,1226339,1226375,1228816,1229059
+/httpd/httpd/trunk:1201042,1201111,1201194,1201198,1201202,1202236,1202456,1202886,1203859,1204630,1204968,1204990,1205061,1205075,1205379,1205885,1206291,1206587,1206850,1207719,1208753,1208835,1209053,1209085,1209417,1209432,1209461,1209601,1209603,1209618,1209623,1209741,1209754,1209766,1209776,1209797-1209798,1209811-1209812,1209814,1209908,1209910,1209913,1209916-1209917,1209947,1209952,1210080,1210124,1210130,1210219,1210221,1210252,1210284,1210378,1210725,1210892,1210951,1210954,1211528,1211663,1211680,1212883,1213338,1213567,1214003,1214005,1214015,1220462,1220467,1220493,1220524,1220570,1220768,1220794,1220826,1220846,1221292,1222335,1222370,1222473,1222915,1222917,1222921,1223048,1225060,1225197-1225198,1225380,1225476,1225478,1225791,1225795-1225796,1226339,1226375,1228816,1229059,1229134,1229136

Modified: httpd/httpd/branches/2.4.x/include/ap_config.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/ap_config.h?rev=1229139&r1=1229138&r2=1229139&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/ap_config.h (original)
+++ httpd/httpd/branches/2.4.x/include/ap_config.h Mon Jan  9 13:18:26 2012
@@ -177,17 +177,27 @@
 #define __has_attribute(x) 0
 #endif
 #if (defined(__GNUC__) && __GNUC__ >= 4) || __has_attribute(sentinel)
-#define ap_func_attr_sentinel __attribute__((sentinel))
+#define AP_FN_ATTR_SENTINEL __attribute__((sentinel))
 #else
-#define ap_func_attr_sentinel
+#define AP_FN_ATTR_SENTINEL
 #endif
 
 #if ( defined(__GNUC__) &&                                        \
       (__GNUC__ >= 4 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4))) \
     || __has_attribute(warn_unused_result)
-#define ap_func_attr_warn_unused_result   __attribute__((warn_unused_result))
+#define AP_FN_ATTR_WARN_UNUSED_RESULT   __attribute__((warn_unused_result))
 #else
-#define ap_func_attr_warn_unused_result
+#define AP_FN_ATTR_WARN_UNUSED_RESULT
+#endif
+
+#if ( defined(__GNUC__) &&                                        \
+      (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3))                     \
+    || __has_attribute(alloc_size)
+#define AP_FN_ATTR_ALLOC_SIZE(x)     __attribute__((alloc_size(x)))
+#define AP_FN_ATTR_ALLOC_SIZE2(x,y)  __attribute__((alloc_size(x,y)))
+#else
+#define AP_FN_ATTR_ALLOC_SIZE(x)
+#define AP_FN_ATTR_ALLOC_SIZE2(x,y)
 #endif
 
 #endif /* AP_CONFIG_H */

Modified: httpd/httpd/branches/2.4.x/include/http_protocol.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/http_protocol.h?rev=1229139&r1=1229138&r2=1229139&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/http_protocol.h (original)
+++ httpd/httpd/branches/2.4.x/include/http_protocol.h Mon Jan  9 13:18:26 2012
@@ -355,7 +355,7 @@ static APR_INLINE int ap_rputs(const cha
  * @return The number of bytes sent
  */
 AP_DECLARE_NONSTD(int) ap_rvputs(request_rec *r,...)
-                       ap_func_attr_sentinel;
+                       AP_FN_ATTR_SENTINEL;
 
 /**
  * Output data to the client in a printf format

Modified: httpd/httpd/branches/2.4.x/include/http_request.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/http_request.h?rev=1229139&r1=1229138&r2=1229139&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/http_request.h (original)
+++ httpd/httpd/branches/2.4.x/include/http_request.h Mon Jan  9 13:18:26 2012
@@ -285,7 +285,7 @@ AP_DECLARE(void) ap_update_mtime(request
  * @return  None.
  */
 AP_DECLARE(void) ap_allow_methods(request_rec *r, int reset, ...)
-                 ap_func_attr_sentinel;
+                 AP_FN_ATTR_SENTINEL;
 
 /**
  * Add one or more methods to the list permitted to access the resource.

Modified: httpd/httpd/branches/2.4.x/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/httpd.h?rev=1229139&r1=1229138&r2=1229139&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/httpd.h (original)
+++ httpd/httpd/branches/2.4.x/include/httpd.h Mon Jan  9 13:18:26 2012
@@ -2136,7 +2136,9 @@ AP_DECLARE(void) ap_abort_on_oom(void) _
  * @return pointer to the allocated memory
  * @note ap_malloc may be implemented as a macro
  */
-AP_DECLARE(void *) ap_malloc(size_t size) __attribute__((malloc));
+AP_DECLARE(void *) ap_malloc(size_t size)
+                    __attribute__((malloc))
+                    AP_FN_ATTR_ALLOC_SIZE(1);
 
 /**
  * Wrapper for calloc() that calls ap_abort_on_oom() if out of memory
@@ -2145,7 +2147,9 @@ AP_DECLARE(void *) ap_malloc(size_t size
  * @return pointer to the allocated memory
  * @note ap_calloc may be implemented as a macro
  */
-AP_DECLARE(void *) ap_calloc(size_t nelem, size_t size) __attribute__((malloc));
+AP_DECLARE(void *) ap_calloc(size_t nelem, size_t size)
+                   __attribute__((malloc))
+                   AP_FN_ATTR_ALLOC_SIZE2(1,2);
 
 /**
  * Wrapper for realloc() that calls ap_abort_on_oom() if out of memory
@@ -2155,7 +2159,8 @@ AP_DECLARE(void *) ap_calloc(size_t nele
  * @note ap_realloc may be implemented as a macro
  */
 AP_DECLARE(void *) ap_realloc(void *ptr, size_t size)
-                   ap_func_attr_warn_unused_result;
+                   AP_FN_ATTR_WARN_UNUSED_RESULT
+                   AP_FN_ATTR_ALLOC_SIZE(2);
 
 
 #define AP_NORESTART APR_OS_START_USEERR + 1

Modified: httpd/httpd/branches/2.4.x/include/util_cookies.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/util_cookies.h?rev=1229139&r1=1229138&r2=1229139&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/util_cookies.h (original)
+++ httpd/httpd/branches/2.4.x/include/util_cookies.h Mon Jan  9 13:18:26 2012
@@ -68,7 +68,7 @@ typedef struct {
 AP_DECLARE(apr_status_t) ap_cookie_write(request_rec * r, const char *name,
                                          const char *val, const char *attrs,
                                          long maxage, ...)
-                         ap_func_attr_sentinel;
+                         AP_FN_ATTR_SENTINEL;
 
 /**
  * Write an RFC2965 compliant cookie.
@@ -85,7 +85,7 @@ AP_DECLARE(apr_status_t) ap_cookie_write
 AP_DECLARE(apr_status_t) ap_cookie_write2(request_rec * r, const char *name2,
                                           const char *val, const char *attrs2,
                                           long maxage, ...)
-                         ap_func_attr_sentinel;
+                         AP_FN_ATTR_SENTINEL;
 
 /**
  * Remove an RFC2109 compliant cookie.
@@ -99,7 +99,7 @@ AP_DECLARE(apr_status_t) ap_cookie_write
  */
 AP_DECLARE(apr_status_t) ap_cookie_remove(request_rec * r, const char *name,
                                           const char *attrs, ...)
-                         ap_func_attr_sentinel;
+                         AP_FN_ATTR_SENTINEL;
 
 /**
  * Remove an RFC2965 compliant cookie.
@@ -113,7 +113,7 @@ AP_DECLARE(apr_status_t) ap_cookie_remov
  */
 AP_DECLARE(apr_status_t) ap_cookie_remove2(request_rec * r, const char *name2,
                                            const char *attrs2, ...)
-                         ap_func_attr_sentinel;
+                         AP_FN_ATTR_SENTINEL;
 
 /**
  * Read a cookie called name, placing its value in val.

Modified: httpd/httpd/branches/2.4.x/include/util_filter.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/util_filter.h?rev=1229139&r1=1229138&r2=1229139&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/util_filter.h (original)
+++ httpd/httpd/branches/2.4.x/include/util_filter.h Mon Jan  9 13:18:26 2012
@@ -568,7 +568,7 @@ AP_DECLARE(apr_status_t) ap_fflush(ap_fi
 AP_DECLARE_NONSTD(apr_status_t) ap_fputstrs(ap_filter_t *f,
                                             apr_bucket_brigade *bb,
                                             ...)
-                                ap_func_attr_sentinel;
+                                AP_FN_ATTR_SENTINEL;
 
 /**
  * Output data to the filter in printf format

Modified: httpd/httpd/branches/2.4.x/include/util_script.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/util_script.h?rev=1229139&r1=1229138&r2=1229139&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/util_script.h (original)
+++ httpd/httpd/branches/2.4.x/include/util_script.h Mon Jan  9 13:18:26 2012
@@ -155,7 +155,7 @@ AP_DECLARE_NONSTD(int) ap_scan_script_he
                                                       char *buffer,
                                                       const char **termch,
                                                       int *termarg, ...)
-                       ap_func_attr_sentinel;
+                       AP_FN_ATTR_SENTINEL;
 
 /**
  * Read headers strings from a script, ensuring that the output is valid.  If
@@ -178,7 +178,7 @@ AP_DECLARE_NONSTD(int) ap_scan_script_he
                                                          int module_index,
                                                          const char **termch,
                                                          int *termarg, ...)
-                       ap_func_attr_sentinel;
+                       AP_FN_ATTR_SENTINEL;
 
 
 /**