[OpenAFS-devel] gcc 4.0, Fedora Core 4 patch

Jeffrey Hutzelman jhutz@cmu.edu
Fri, 17 Jun 2005 03:16:50 -0400


On Thursday, June 16, 2005 10:43:22 AM -0400 Adam Goode 
<agoode@andrew.cmu.edu> wrote:

> Here is a tiny patch to get OpenAFS working on Fedora Core 4. FC4 builds
> everything, including the kernel, with GCC 4.0. Without this patch,
> compilation of the kernel modules dies with "struct coda_inode_info
> redefined" and "struct xfs_inode_info redefined".
>
> This patch just removes these definitions from src/afs/sysincludes.h. I
> don't know if this is correct in all cases, but it does work here. Also,
> do the nearby #define statements need to go? I'm not sure.


Just ripping out code because it doesn't work on your machine is not really 
a fix; it's just a hack.  Better to fix the underlying problem, if there is 
one, or deal with the portability issues.

The right fix is to move the #endif so that struct coda_inode_info is 
defined here only if _LINUX_CODA_FS_I was not already defined, and to put 
an equivalent conditional around the definitions of _LINUX_XFS_FS_I and 
struct xfs_inode_info.  This should happen in both src/afs/sysinclude.h and 
in src/rx/rx_kcommon.h

-- Jeffrey T. Hutzelman (N3NHS) <jhutz+@cmu.edu>
   Sr. Research Systems Programmer
   School of Computer Science - Research Computing Facility
   Carnegie Mellon University - Pittsburgh, PA