std-unix@longway.TIC.COM (Moderator, John S. Quarterman) (11/22/89)
From: Andy Tanenbaum <uunet!cs.vu.nl!ast> The ANSI C standard specifically states that it is legal for an application program to include the ANSI headers (e.g., <limits.h>) multiple times in a program. What about the POSIX headers that are not in the ANSI std, such as <unistd.h> and <sys/wait.h>. Is an implementation required to behave correctly if they are included multiple times? If so, could somebody point out the section in P1003.1 where this is stated. Thanks. Andy Tanenbaum (ast@cs.vu.nl) Volume-Number: Volume 17, Number 64
jeffrey@algor2.algorists.com (Jeffrey Kegler) (11/24/89)
From: jeffrey@algor2.algorists.com (Jeffrey Kegler) In article <436@longway.TIC.COM> Andy Tanenbaum <uunet!cs.vu.nl!ast> writes: >From: Andy Tanenbaum <uunet!cs.vu.nl!ast> > >The ANSI C standard specifically states that it is legal for an >application program to include the ANSI headers (e.g., <limits.h>) >multiple times in a program. > >What about the POSIX headers that are not in the ANSI std, such as ><unistd.h> and <sys/wait.h>. Is an implementation required to behave >correctly if they are included multiple times? If so, could somebody >point out the section in P1003.1 where this is stated. >From 2.8.1 of 1003.1: "Additionally, the C Standard requires that it be possible to include a header more than once, and that a symbol may be defined in more than one header. This requirement is also made of headers for this standard." This seems to say yes in answer to the above question. -- Jeffrey Kegler, Independent UNIX Consultant, Algorists, Inc. jeffrey@algor2.ALGORISTS.COM or uunet!algor2!jeffrey 1762 Wainwright DR, Reston VA 22090 Volume-Number: Volume 17, Number 68