Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* messy include files - pid_t undefined?
@ 1997-09-24 13:05 Harvey J. Stein
  0 siblings, 0 replies; 7+ messages in thread
From: Harvey J. Stein @ 1997-09-24 13:05 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: messy include files - pid_t undefined?
@ 1997-09-24 13:19 Ronny Ranerup
  1997-09-24 13:31 ` Tom Browder
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ronny Ranerup @ 1997-09-24 13:19 UTC (permalink / raw)


Harvey J. Stein:
>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?

I agree on the statement and repeat the question. The header files seem really 
messed up on the (RedHat) Alpha. I actually thought there was something wrong 
with just my installation...

I even had to fix something, somewhere, which generated an error, don't remember 
where though. The warnings below, which I don't get on an Intel box, are from 
the following includes (some non-standard):
 
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <signal.h>
#include <string.h>
#include <stdio.h>
#include <pcap.h>
#include <misc.h>
#include <hash3.h>
#include <sys/time.h>
#include <unistd.h>

---

cc -o snoop snoop.c -I. -I/usr/src/misc -I/usr/src/hash -L/usr/src/misc -L/usr/src/hash -L/usr/src/turtle -I/usr/src/turtle -L/usr/X11/lib -ansi -g -lm -lpcap -lmisc -lhash -lX11 -lturtle
In file included from /usr/include/arpa/inet.h:42,
                 from snoop.c:9:
/usr/include/sys/types.h:42: warning: redefinition of `dev_t'
/usr/include/linux/types.h:10: warning: `dev_t' previously declared here
/usr/include/sys/types.h:43: warning: redefinition of `gid_t'
/usr/include/linux/types.h:17: warning: `gid_t' previously declared here
/usr/include/sys/types.h:44: warning: redefinition of `ino_t'
/usr/include/linux/types.h:11: warning: `ino_t' previously declared here
/usr/include/sys/types.h:45: warning: redefinition of `mode_t'
/usr/include/linux/types.h:12: warning: `mode_t' previously declared here
/usr/include/sys/types.h:46: warning: redefinition of `nlink_t'
/usr/include/linux/types.h:13: warning: `nlink_t' previously declared here
/usr/include/sys/types.h:47: warning: redefinition of `off_t'
/usr/include/linux/types.h:14: warning: `off_t' previously declared here
/usr/include/sys/types.h:49: warning: redefinition of `pid_t'
/usr/include/linux/types.h:15: warning: `pid_t' previously declared here
/usr/include/sys/types.h:50: warning: redefinition of `uid_t'
/usr/include/linux/types.h:16: warning: `uid_t' previously declared here
/usr/include/sys/types.h:53: warning: redefinition of `ssize_t'
/usr/include/linux/types.h:35: warning: `ssize_t' previously declared here
In file included from /usr/include/sys/types.h:67,
                 from /usr/include/arpa/inet.h:42,
                 from snoop.c:9:
/usr/include/time.h:76: warning: redefinition of `time_t'
/usr/include/linux/types.h:45: warning: `time_t' previously declared here
In file included from /usr/include/sys/time.h:24,
                 from /usr/local/include/pcap.h:40,
                 from snoop.c:18:
/usr/include/time.h:64: warning: redefinition of `clock_t'
/usr/include/linux/types.h:50: warning: `clock_t' previously declared here

---

/ronny@axis.com/Ronny Ranerup/Axis Communications AB/http://www.axis.com

--
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

^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <199709241305.PAA04758@blinky.bfr.co.il>]
[parent not found: <199709241509.LAA15324@headwall.maine.com>]

end of thread, other threads:[~1997-09-28  4:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-09-24 13:05 messy include files - pid_t undefined? Harvey J. Stein
  -- strict thread matches above, loose matches on Subject: below --
1997-09-24 13:19 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

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