diff -Nur openafs-1.6.1.orig/src/cf/linux-test1.m4 openafs-1.6.1/src/cf/linux-test1.m4 --- openafs-1.6.1.orig/src/cf/linux-test1.m4 2012-03-27 01:03:34.000000000 +0200 +++ openafs-1.6.1/src/cf/linux-test1.m4 2012-09-13 17:24:34.920364986 +0200 @@ -18,6 +18,10 @@ cat >>conftest.dir/conftest.c <<\_ACEOF && /* end confdefs.h */ #include +#include +#ifndef __no_const +#define __no_const +#endif $1 void conftest(void) @@ -135,7 +139,8 @@ [AC_CHECK_LINUX_BUILD([for $2 in $1], [ac_cv_linux_$1_has_$2], [#include ], - [$1 _test; printk("%x\n", &_test.$2); ], + [struct { $1 _s; int _i; } _test; + printk("%x\n", &_test._s.$2); ], AS_TR_CPP($1_HAS_$2), [Define if kernel typedef'd $1 has the $2 element]) ]) diff -Nur openafs-1.6.1.orig/src/cf/linux-test4.m4 openafs-1.6.1/src/cf/linux-test4.m4 --- openafs-1.6.1.orig/src/cf/linux-test4.m4 2012-03-27 01:03:34.000000000 +0200 +++ openafs-1.6.1/src/cf/linux-test4.m4 2012-09-13 17:20:00.315617657 +0200 @@ -175,10 +175,10 @@ [#include #include #include ], -[struct address_space_operations _aops; +[struct { struct address_space_operations _s; int _i; } _aops; struct page _page; struct writeback_control _writeback_control; -(void)_aops.writepage(&_page, &_writeback_control);], +(void)_aops._s.writepage(&_page, &_writeback_control);], [AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL], [define if aops.writepage takes a struct writeback_control], []) @@ -520,7 +520,7 @@ AC_CHECK_LINUX_BUILD([if kernel uses new export ops], [ac_cv_linux_new_export_ops], [#include ], - [struct export_operations _eops; + [typedef struct export_operations __no_const _s; _s _eops; _eops.fh_to_parent(NULL, NULL, 0, 0);], [NEW_EXPORT_OPS], [define if kernel uses new export ops], @@ -627,7 +627,7 @@ [ac_cv_linux_dop_d_delete_takes_const], [#include #include ], - [struct dentry_operations _d_ops; + [typedef struct dentry_operations __no_const _s; _s _d_ops; int _d_del(const struct dentry *de) {return 0;}; _d_ops.d_delete = _d_del;], [DOP_D_DELETE_TAKES_CONST], @@ -640,7 +640,7 @@ AC_CHECK_LINUX_BUILD([whether inode.i_op->mkdir takes a umode_t argument], [ac_cv_linux_iop_mkdir_takes_umode_t], [#include ], - [struct inode_operations _i_ops; + [typedef struct inode_operations __no_const _s; _s _i_ops; int _mkdir(struct inode *i, struct dentry *d, umode_t m) {return 0;}; _i_ops.mkdir = _mkdir;], [IOP_MKDIR_TAKES_UMODE_T], @@ -653,7 +653,7 @@ AC_CHECK_LINUX_BUILD([whether inode.i_op->create takes a umode_t argument], [ac_cv_linux_iop_create_takes_umode_t], [#include ], - [struct inode_operations _i_ops; + [typedef struct inode_operations __no_const _s; _s _i_ops; int _create(struct inode *i, struct dentry *d, umode_t m, struct nameidata *n) {return 0;}; _i_ops.create = _create;], diff -Nur openafs-1.6.1.orig/src/rx/rx_event.h openafs-1.6.1/src/rx/rx_event.h --- openafs-1.6.1.orig/src/rx/rx_event.h 2012-03-27 01:03:34.000000000 +0200 +++ openafs-1.6.1/src/rx/rx_event.h 2012-09-13 17:37:52.958628614 +0200 @@ -36,7 +36,12 @@ union { void (*oldfunc) (struct rxevent *, void *, void *); void (*newfunc) (struct rxevent *, void *, void *, int); - } func; /* Function to call when this expires */ + } +#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 5 && \ + defined(CONSTIFY_PLUGIN) + __attribute__((__no_const__)) +#endif + func; /* Function to call when this expires */ void *arg; /* Argument to the function */ void *arg1; /* Another argument */ int arg2; /* An integer argument */