From: Frank Wortner <frank () bondnet ! com>
To: tru64-unix-managers
Subject: Compaq C++ Question
Date: Tue, 22 May 2001 18:55:53 +0000 [thread overview]
Message-ID: <102653647622044.tru64-unix-managers.marc@archive.invalid> (raw)
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
reply other threads:[~2001-05-22 18:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox