From: Harvey J. Stein <abel@netvision.net.il>
Subject: messy include files - pid_t undefined?
Date: Wed, 24 Sep 1997 15:05:21 +0200 [thread overview]
Message-ID: <51bafa132d22fc7541d738f7269e2f2a.axp-list@archive.invalid> (raw)
It seems that pid_t is undefined by default on linux/axp, even though
the man pages say it should be defined in unistd.h:
hjstein@randy:~$ uname -a
Linux randy.bloomberg.com 2.0.30 #1 Tue Apr 22 16:32:38 EDT 1997 alpha unknown
hjstein@randy:~$ cat ppid_test.c
#include <unistd.h>
foo (void) {
pid_t n;
}
hjstein@randy:~$ gcc -c -o ppid_test.o ppid_test.c
ppid_test.c: In function `foo':
ppid_test.c:4: `pid_t' undeclared (first use this function)
ppid_test.c:4: (Each undeclared identifier is reported only once
ppid_test.c:4: for each function it appears in.)
ppid_test.c:4: parse error before `n'
Compare this to linux/intel:
hjstein@blinky:~$ uname -a
Linux blinky 2.0.30 #1 Thu Jul 10 18:38:08 IDT 1997 i586
hjstein@blinky:~$ gcc -c -o ppid_test.o ppid_test.c
Eventually, I discovered pid_t declared in /usr/include/linux/types.h,
but wrapped with an #ifndef __KERNEL_STRICT_NAMES/#endif.
I then found that on the alpha, __KERNEL_STRICT_NAMES is defined in
/usr/include/features.h, but is not defined anywhere in the
linux/intel headers.
It says in /usr/include/features.h on the alpha that:
#undef __KERNEL_STRICT_NAMES
/* Suppress kernel-name space pollution unless user expressedly asks
for it. */
#ifndef _LOOSE_KERNEL_NAMES
# define __KERNEL_STRICT_NAMES
#endif
However, if I define _LOOSE_KERNEL_NAMES then although the above
compiles, it still gives a warning:
hjstein@randy:~$ gcc -D_LOOSE_KERNEL_NAMES -c -o ppid_test.o ppid_test.c
In file included from ppid_test.c:1:
/usr/include/unistd.h:151: warning: redefinition of `ssize_t'
/usr/include/linux/types.h:35: warning: `ssize_t' previously declared here
Finally, if I add #include <sys/types.h> to the top of the code (as
Donald Lewine's POSIX Programmer's Guide indicates is needed), the
code compiles without problem *without* -D_LOOSE_KERNEL_NAMES, and
causes *many* warnings when compiled *with* -D_LOOSE_KERNEL_NAMES.
Of course, the alpha box is using glibc-0.961212, and the intel box is
using libc-5.3.12. So evidently there is a bug either in the glibc
headers, or the libc headers & the man pages.
So, which is it & who should I email about it? Is there someone on
this list looking into/fixing such things, or should I email a glibc
mailing list or the linux libc mailing list or a particular person or
...?
In general I've been seeing various warnings from the standard header
files when compiling on the alpha. Again, are they being fixed, or
should I email this list, or some other list, or someone in particular
with the ones I've seen?
Thanks,
--
Harvey J. Stein
Berger Financial Research
hjstein@bfr.co.il
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
next reply other threads:[~1997-09-24 13:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-09-24 13:05 Harvey J. Stein [this message]
-- strict thread matches above, loose matches on Subject: below --
1997-09-24 13:19 messy include files - pid_t undefined? Ronny Ranerup
1997-09-24 13:31 ` Tom Browder
1997-09-24 15:09 ` Christopher F. Miller
1997-09-28 4:10 ` Richard Henderson
[not found] <199709241305.PAA04758@blinky.bfr.co.il>
1997-09-28 4:02 ` Richard Henderson
[not found] <199709241509.LAA15324@headwall.maine.com>
1997-09-28 4:16 ` Richard Henderson
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