Paul Eggert wrote: > On 09/07/11 02:49, Bruno Haible wrote: > > -#include <fcntl.h> > > +/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc > > miscompiles > > + openat.c because that file has a preliminary #include <fcntl.h>. */ > > +#include "fcntl.h" > > Thanks. Is a similar change needed to lib/open.c, > which plays the same trick with fcntl.h? > > Also, to lib/fstatat.c, lib/lstat.c, lib/stat.c, > which play a similar trick with <sys/stat.h>?
Yes, you're right. Also, the workaround belongs in the openat.c file, not in openat.h. (That will teach me to make commits in a hurry.) > And if so, why didn't these other examples > turn up in testing? We were just lucky. I've reverted the earlier, broken commit, and added this one instead: 2011-09-07 Bruno Haible <br...@clisp.org> openat: Work around compilation error with OSF/1 5.1 DTK cc. * lib/fopen.c: Use different syntax for include of <stdio.h>. * lib/freopen.c: Likewise. * lib/fstatat.c: Use different syntax for include of <sys/stat.h>. * lib/lstat.c: Likewise. * lib/stat.c: Likewise. * lib/open.c: Use different syntax for include of <fcntl.h>. * lib/openat.c: Include fcntl.h again, explicitly. --- lib/fopen.c.orig Wed Sep 7 23:59:56 2011 +++ lib/fopen.c Wed Sep 7 23:56:18 2011 @@ -33,7 +33,9 @@ } /* Specification. */ -#include <stdio.h> +/* Write "stdio.h" here, not <stdio.h>, otherwise OSF/1 5.1 DTK cc eliminates + this include because of the preliminary #include <stdio.h> above. */ +#include "stdio.h" #include <errno.h> #include <fcntl.h> --- lib/freopen.c.orig Wed Sep 7 23:59:56 2011 +++ lib/freopen.c Wed Sep 7 23:56:28 2011 @@ -33,7 +33,9 @@ } /* Specification. */ -#include <stdio.h> +/* Write "stdio.h" here, not <stdio.h>, otherwise OSF/1 5.1 DTK cc eliminates + this include because of the preliminary #include <stdio.h> above. */ +#include "stdio.h" #include <string.h> --- lib/fstatat.c.orig Wed Sep 7 23:59:56 2011 +++ lib/fstatat.c Wed Sep 7 23:57:23 2011 @@ -36,7 +36,10 @@ } #endif -#include <sys/stat.h> +/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc + eliminates this include because of the preliminary #include <sys/stat.h> + above. */ +#include "sys/stat.h" #include <errno.h> #include <fcntl.h> --- lib/lstat.c.orig Wed Sep 7 23:59:56 2011 +++ lib/lstat.c Wed Sep 7 23:57:42 2011 @@ -42,7 +42,10 @@ } /* Specification. */ -# include <sys/stat.h> +/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc + eliminates this include because of the preliminary #include <sys/stat.h> + above. */ +# include "sys/stat.h" # include <string.h> # include <errno.h> --- lib/open.c.orig Wed Sep 7 23:59:56 2011 +++ lib/open.c Wed Sep 7 23:58:25 2011 @@ -34,7 +34,9 @@ } /* Specification. */ -#include <fcntl.h> +/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates + this include because of the preliminary #include <fcntl.h> above. */ +#include "fcntl.h" #include <errno.h> #include <stdarg.h> --- lib/openat.c.orig Wed Sep 7 23:59:56 2011 +++ lib/openat.c Wed Sep 7 23:58:41 2011 @@ -35,6 +35,10 @@ } #endif +/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates + this include because of the preliminary #include <fcntl.h> above. */ +#include "fcntl.h" + #include "openat.h" #include <stdarg.h> --- lib/stat.c.orig Wed Sep 7 23:59:56 2011 +++ lib/stat.c Wed Sep 7 23:58:03 2011 @@ -34,7 +34,10 @@ } /* Specification. */ -#include <sys/stat.h> +/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc + eliminates this include because of the preliminary #include <sys/stat.h> + above. */ +#include "sys/stat.h" #include <errno.h> #include <limits.h> -- In memoriam Joseph Lee Heywood <http://en.wikipedia.org/wiki/Joseph_Lee_Heywood>