Coda File System

Re: GCC 3.1 compilation

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Mon, 3 Jun 2002 10:27:50 -0400
On Mon, Jun 03, 2002 at 01:44:09AM -0700, Robert Coie wrote:
> When compiling coda 5.3.19 using GCC 3.1 under i686 Gentoo Linux, I
> ran into a couple of problems with redefined default arguments to
> functions in fso_cachefile.cc.  Below is a simple patch that removes
> the second default argument declaration:

I'll apply that one.

> In addition, I also noticed a slew of warnings (mostly in
> coda-src/vol) about the tactic used in struct.h to backtrack to the
> base address of a structure given a pointer to a structure member.
> GCC 3.1 seems to suggest the use of a pointer-to-member in this
> situation.  I haven't done a whole lot of C++ in several years, and I

We notices several miscompilations with GCC 3.0, most of these were
actually caused by Coda's abuse of 'compatibility' between C structs
and C++ classes. It is good to hear that GCC 3.1 actually seems to warn
about possible miscompilations in this area, but Coda uses casts in too
many places to assume that it will catch all possible bugs this way.

In short, even if it compiles, expect problems with a gcc 3.XX compiled
Coda client. And although there seem to be fewer C++ hacks in the server
coda, possibly even a server can do some seriously bad things to your
data.

Jan
Received on 2002-06-03 10:28:47