[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: groff 1.17.2 fails to build under vax-dec-ultrix4.3

From: John David Anglin
Subject: Re: groff 1.17.2 fails to build under vax-dec-ultrix4.3
Date: Mon, 16 Jul 2001 11:36:23 -0400 (EDT)

> > While a small autoconf check could detect the problem, it seems kind
> > of messy to work around.  Presumably, you want to include stdlib.h
> > and use atexit?
> ? I don't know what you mean.  Please explain.

If you try to redeclare atexit after including stdlib.h, this is what happens:

% g++ -S -W -Wall atexit.cc
atexit.cc:3: declaration of C function `int atexit(void (*)())' conflicts with
/usr/local/lib/gcc-lib/vax-dec-ultrix4.3/3.0/include/stdlib.h:116: previous 
   declaration `int atexit(void (*)(...))' here

This was the test program:

#include <stdlib.h>
extern "C" {
extern int atexit(void (*) (void));

void foo (void)

int main (int argc, char **argv)
  atexit (foo);
  exit (0);

Without the redeclaration, you get:

% g++ -c -W -Wall atexit.cc
atexit.cc: In function `int main(int, char**)':
atexit.cc:9: cannot convert `void (*)()' to `void (*)(...)' for argument `1' to 
   `int atexit(void (*)(...))'

The only workaround that I can see is to have a C function "my_atexit" that
has a proper prototype for C++ and calls atexit.

J. David Anglin                                  address@hidden
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]