tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Compaq C++ Question
@ 2001-05-22 18:55 Frank Wortner
  0 siblings, 0 replies; only message in thread
From: Frank Wortner @ 2001-05-22 18:55 UTC (permalink / raw)
  To: tru64-unix-managers

A couple of developers walked into my office with the following program:


#include <signal.h>
#include <stdio.h>

void
main()
{
signal(SIGFPE, SIG_DFL);
printf("hello\n");
return;
}

They had named it "test.cxx" and fed it to Compaq C++ Version 6.3A.

cxx -std strict_ansi_errors test.cxx

The result they got was:

cxx: Warning: test.cxx, line 5: return type of function "main" must be "int"
main()
^
cxx: Error: test.cxx, line 7: argument of type "void (*)()" is incompatible
          with parameter of type "void (*)(int) C"
signal(SIGFPE, SIG_DFL);
---------------^
cxx: Info: 1 error detected in the compilation of "test.cxx".

The program compiles correctly without the "-std strict_ansi_errors" option,
and they want to know why.  Now,  I'm really old  ;-),  so I don't
understand a lot of C++'s ins and outs.  Could anyone help me come up with a
reasonable explanation?

Thanks!

Frank


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-22 18:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-22 18:55 Compaq C++ Question Frank Wortner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox