fam
[Top] [All Lists]

Re: [fam] GCC-3.1 compilation problems...

To: Lars Pechan <lars.pechan@xxxxxxxxxxxxxxx>
Subject: Re: [fam] GCC-3.1 compilation problems...
From: Michael Wardle <michael.wardle@xxxxxxxxxx>
Date: Wed, 29 May 2002 18:53:35 +1000
Cc: fam@xxxxxxxxxxx
Organization: Adacel Technologies
References: <200205280102.18620.lars.pechan@xxxxxxxxxxxxxxx>
Sender: owner-fam@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc2) Gecko/20020512 Netscape/7.0b1
Lars Pechan wrote:
> I'm trying to build fam-oss 2.6.7 using Gentoo Linux i386 with
> gcc3.1 and get the following output:
>
> c++ -DHAVE_CONFIG_H -I. -I. -I.. -I../include
> -DCONFIG_ETC_CONFIG_PATH=\"/etc/fam.conf\"    -Wno-deprecated -c
> Scheduler.c++
> Scheduler.c++:37: uninitialized const member
> `Scheduler::IOTypeInfo::iotype'
> Scheduler.c++:38: uninitialized const member
> `Scheduler::IOTypeInfo::iotype'
> make[2]: *** [Scheduler.o] Error 1
> make[2]: Leaving directory
> `/var/tmp/portage/fam-oss-2.6.7/work/fam-2.6.7/fam'

(Line numbers from FAM 2.6.7)

At line 107 of Scheduler.h, struct IOTypeInfo has a member iotype that
is given a "const" modifier.  At line 123, two variables of type
IOTypeInfo, "read" and "write" are declared.

As I'm more familiar with C than C++ (and I'm learning Java at the
moment, so the exact terminologies and nuances of each is becoming a
blur), there's a couple of things I'm trying to figure out...

1. Is the position of the const modifier correct?  I'm accustomed to
    seeing it before the type.  Is it possible to put the modifier
    elsewhere in C++?
2. Is the IOTypeInfo constructor called when "read" and "write" are
    first declared at line 123?  If so, then this means they are
    actually instantiated, not declared, correct?  If so, then
    presumably calling the constructor at lines 37 and 38 of
    Scheduler.c++ is trying to modify an already initialized const
    member.  If so, how can this be overcome (other than removing the
    const modifier, which seems to be a bad idea)?  If not, why
    would the error be occurring at all?


--
MICHAEL WARDLE
SGI Desktop & Admin Software
Adacel Technologies Limited




--
Source code, list archive, and docs: http://oss.sgi.com/projects/fam/
To unsubscribe: echo unsubscribe fam | mail majordomo@xxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>