www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1998/07/31/09:09:54

X-pop3-spooler: POP3MAIL 2.1.0 b 4 980420 -bs-
From: lambache AT biochem DOT mpg DOT de
Date: Fri, 31 Jul 1998 10:59:51 -0400
Message-Id: <199807311459.KAA257.28@pcfr39.biochem.mpg.de>
To: beastium-list AT Desk DOT nl
Subject: pointer-to-function difference betwenn gcc2.7.2.1 and pgcc for OS/2
Sender: Marc Lehmann <pcg AT goof DOT com>
Status: RO
X-Status: A
Lines: 67

Hi,

I have a source file, that compiles fine with emx-gcc2.7.2.1, but pgcc refuses
to compile with an error message.

Code:

void vector_integral::_driver(void (vector_integral::*method)(void), double* result)
{
   Some statements omitted...

  for(_actual_iteration=1;_actual_iteration<=_max_iteration;_actual_iteration++)
  {
-->    method();                 <-----------------------------------pgcc chokes here

    cout << "driver[" << _a << ".." << _b << "]: done iteration "
         << _actual_iteration << endl;

    if (_error_reached())

   Rest omitted

_driver is a member function of vector_integral, that can be called by different
interface routines. The interface routines set method to the adress of a member
function of vector_integral, which performs a special form og integration.
The integration functions are defined as following, e.g.:

void vector_integral::_do_trapez()
{
  double* h1;
  double* h2;
  
  Rest omitted

There are some other functions which do different forms of intgeration.

>From pgcc I get the following error message:

numerik.cxx: In method `void vector_integral::_driver(void (vector_integral::*)(
), double *)':
numerik.cxx:540: must use .* or ->* to call pointer-to-member function in `metho
d (...)'
make: *** [numerik.o] Error 1


Line 540 is the marked line above.

emx-gcc 2.7.2.1 compiles this without even a warning

The version of pgcc I used is:
pgcc-2.90.27 980315 (egcs-1.0.2 release)

Frankly, I do not even understand the error message. I tried to fumble around with
typecasts, but this didn't yield anything besides other error messages 8-)

Any help is greatly appreciated

Armin

-- 
--------------------------------------------------------------------------------
Armin Lambacher                                 email: lambache AT biochem DOT mpg DOT de

"Ich sag' nicht viel, aber was ich sag' ist Quatsch." (Pippi Langstrumpf)

"He, der Kerl hat 'ne Meise, aber Rueckenwind!" (thomas d)
--------------------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019