* 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
* Re: messy include files - pid_t undefined?
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
2 siblings, 0 replies; 7+ messages in thread
From: Tom Browder @ 1997-09-24 13:31 UTC (permalink / raw)
Concur with others--among other things I've had
to add "-include /usr/include/stdlib.h" to gcc line
to prevent many such problems--not sure how to
truly fix it.
Tom Browder
ASI Systems International
--
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
@ 1997-09-24 15:09 ` Christopher F. Miller
1997-09-28 4:10 ` Richard Henderson
2 siblings, 0 replies; 7+ messages in thread
From: Christopher F. Miller @ 1997-09-24 15:09 UTC (permalink / raw)
> 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...
> /usr/include/sys/types.h:42: warning: redefinition of `dev_t'
> /usr/include/linux/types.h:10: warning: `dev_t' previously declared here
No, this seems pretty universal with RedHat alpha.
My interpretation of gnu, gcc and glibc faqs is that user apps should never
call include/linux tree, and that where a gnu/something.h exists, you should
use that instead of something else, ie use gnu/types.h instead of sys/types.h.
Most of the problems that I have seen seem related to sys/types.h and
the way it arbitrarily (and often needlessly) leads to inclusion of
include/asm files. I've resorted to placing #ifdef CFM into my
/usr/include tree. Yeech.
Just wait till you start playing with __fd_set. ;^)
FWIW I'm abandoning the RPMs and going back to primary sources.
Unfortunately, even the basic tools ( eg gcc ) don't really seem
to exist in state-of-the-art form (2.7.2.3) for alpha.
FWIW 2, my powerpc linux box seems to have much cleaner headers
and I was thinking I'd try to reconstruct based on the dependancies
there.
--
All this because I want stable threads....
cfm
--
Christopher F. Miller, Publisher cfm@maine.com
MaineStreet Communications, Inc 208 Portland Road, Gray, ME 04039
1.207.657.5078 (MTRF 3-5pm) http://www.maine.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
* Re: messy include files - pid_t undefined?
[not found] <199709241305.PAA04758@blinky.bfr.co.il>
@ 1997-09-28 4:02 ` Richard Henderson
0 siblings, 0 replies; 7+ messages in thread
From: Richard Henderson @ 1997-09-28 4:02 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:
The man pages are wrong; pid_t shall be defined in <sys/types.h>.
As for Linux/Intel, you are probably using libc5, which isn't
very good about following the namespace rules of the various
standards, and so you get the observed bleed-over.
Current glibc is very close to conformant with ISO C 89,
ISO 9946-1996 (POSIX.1) and XPG4 (aka Single Unix Standard).
> 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.
Ignore _LOOSE_KERNEL_NAMES and __KERNEL_STRICT_NAMES. There are
quite a few problems with libc headers and kernel headers in the
glibc 1.98 19961212 snapshot.
Glibc 2.0 (stable) and 2.1 (development) fix the bulk of these
problems, hopefully all of them. It is kind of a pain to upgrade,
but you may soon be able to try out a beta of Red Hat 4.8 that
will hopefully make this less traumatic.
r~
--
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
1997-09-24 15:09 ` Christopher F. Miller
@ 1997-09-28 4:10 ` Richard Henderson
2 siblings, 0 replies; 7+ messages in thread
From: Richard Henderson @ 1997-09-28 4:10 UTC (permalink / raw)
> 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
Pet peeve: don't use -ansi unless you know what you are doing.
It is rarely useful. What is does is provide a strict ANSI/ISO
compliant namespace, which _nobody_ (well, hardly anybody)
writes to. Everyone writes to some superset of that, be it
POSIX, BSD or Win32.
But I can say, other than that, your listed headers compile just
fine under glibc 2.0.5. So whatever the brokenness was, it has
been fixed.
r~
--
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?
[not found] <199709241509.LAA15324@headwall.maine.com>
@ 1997-09-28 4:16 ` Richard Henderson
0 siblings, 0 replies; 7+ messages in thread
From: Richard Henderson @ 1997-09-28 4:16 UTC (permalink / raw)
> My interpretation of gnu, gcc and glibc faqs is that user apps should never
> call include/linux tree, and that where a gnu/something.h exists, you should
> use that instead of something else, ie use gnu/types.h instead of sys/types.h.
Correct about not using anything from <linux/*.h>. But
<sys/types.h> is in fact the correct one to use.
We got rid of (moved) <gnu/types.h> for glibc 2.1 to clear up
this confusion. All of the private, do-not-touch, libc internal
only files now reside in <bits/*.h>, and all bear a legend and/or
#error message reminding the user of this fact.
> FWIW 2, my powerpc linux box seems to have much cleaner headers
> and I was thinking I'd try to reconstruct based on the dependancies
> there.
You're probably using glibc 2.0 or even 2.1 there, no?
r~
--
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
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 --
[not found] <199709241305.PAA04758@blinky.bfr.co.il>
1997-09-28 4:02 ` messy include files - pid_t undefined? Richard Henderson
[not found] <199709241509.LAA15324@headwall.maine.com>
1997-09-28 4:16 ` Richard Henderson
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
-- strict thread matches above, loose matches on Subject: below --
1997-09-24 13:05 Harvey J. Stein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox