Subject: RE: Hello world won't compile, what did I do wrong?
To: 'Alfred Perlstein' <bright@rush.net>
From: Steven Grunza <steven.grunza@dgms.com>
List: port-sparc
Date: 06/16/1999 15:03:15
On Wednesday, June 16, 1999 12:40 PM, Alfred Perlstein 
[SMTP:bright@rush.net] wrote:
> On Wed, 16 Jun 1999, Steven Grunza wrote:
>
> > Why doesn't this build?  Can anyone help with this?  It works on 
a
> >
> > NetBSD-1.4 fresh install but not on a NetBSD-1.4 upgrade.
> >
> >
>
>
> try including sys/types.h
>
> -Alfred

Didn't help...


grunza@hw-ss1%(285) cat hello.c
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

int main( void )
{
   printf( "Hello world\n" );
   return( EXIT_SUCCESS );
}
grunza@hw-ss1%(286) gcc -v -o hello hello.c
Using builtin specs.
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
 /usr/libexec/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=91 
-Dsparc -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__ -D__sparc__ -D__NetBSD__ 
-D__KPRINTF_ATTRIBUTE__ -D__sparc -Asystem(unix) -Asystem(NetBSD) 
-Acpu(sparc) -Amachine(sparc) hello.c /tmp/ccEFxdVi.i
GNU CPP version egcs-2.91.60 19981201 (egcs-1.1.1 release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
 /usr/include
End of search list.
 /usr/libexec/cc1 /tmp/ccEFxdVi.i -quiet -dumpbase hello.c -version 
-o /tmp/ccYxhFEl.s
GNU C version egcs-2.91.60 19981201 (egcs-1.1.1 release) 
(sparc-netbsd) compiled by GNU C version egcs-2.91.60 19981201 
(egcs-1.1.1 release).
In file included from hello.c:3:
/usr/include/unistd.h:253: syntax error before `ualarm'
/usr/include/unistd.h:253: warning: parameter names (without types) 
in function declaration
/usr/include/unistd.h:253: warning: data definition has no type or 
storage class
/usr/include/unistd.h:254: warning: parameter names (without types) 
in function declaration
grunza@hw-ss1%(287)

Including <sys/ansi.h> fixed the problem but why is it necessary? 
 What part of the building of a normal C program is supposed to add 
<sys/ansi.h>?