From pascal.niklaus at ipw.agrl.ethz.ch  Tue Dec 19 12:02:20 2006
From: pascal.niklaus at ipw.agrl.ethz.ch (Pascal A. Niklaus)
Date: Tue, 19 Dec 2006 12:02:20 +0100
Subject: [Rd] Error compiling on HP-UX
In-Reply-To: <4586C4E2.2050903@cimr.cam.ac.uk>
References: <200612181434.17135.pascal.niklaus@ipw.agrl.ethz.ch>
	<4586B3C3.1090702@biostat.ku.dk> <4586C4E2.2050903@cimr.cam.ac.uk>
Message-ID: <200612191202.21114.pascal.niklaus@ipw.agrl.ethz.ch>

> > This sits in the include file: We have unconditional declarations
> >    extern sbsize_t sendfile __((int, int, off_t, bsize_t,
> >                                const struct iovec *, int));
> >    extern sbsize_t sendpath __((int, char *, off_t, bsize_t,
> >                                const struct iovec *, int));
> >
> > and then later on
> >
> > #ifdef __STDC__
> > static sbsize_t sendfile __((int, int, off_t, bsize_t, const struct
> > iovec *, int));
> > static sbsize_t sendpath __((int, char *, off_t, bsize_t, const struct
> > iovec *, int));
> > ...
> >
> > which I guess is detected as an error by the gcc compiler. There might
> > be a way of turning this check off, but I can't spot any in my man page
> > for gcc.
>
> That's not quite all there is. The first two are unconditional, but
> the next two are within some deep nested ifdef blocks -
> __STC__ is defined as it should be (I think you can switch this off
> by defining K&R in gcc, but honestly you do *not* want that),
> __cplusplus is not defined as it
> should not be, but I do not understand why/where _APP32_64BIT_OFF_T
> is defined:
> ==========================
> #ifdef _APP32_64BIT_OFF_T
> #ifndef __cplusplus
> #ifdef __STDC__
> static sbsize_t sendfile __((int, int, off_t, bsize_t, const struct
> iovec *, int));
> static sbsize_t sendpath __((int, char *, off_t, bsize_t, const struct
> iovec *, int));
> #else /* __STDC__ */
> static sbsize_t sendfile(a,b,c,d,e,f) int a,b,f; off_t c; bsize_t d;
> __const struct iovec * e; { return __sendfile64(a,b,c,d,e,f\
> ); }
> static sbsize_t sendpath(a,b,c,d,e,f) int a,f; char *b; off_t c; bsize_t
> d; __const struct iovec * e; { return __sendpath64(a,b,\
> c,d,e,f); }
>
> #endif /* __STDC__ */
> #endif /* __cplusplus */
> #endif /* _APP32_64BIT_OFF_T */
> ===========================

_APP32_64BIT_OFF_T gets defined in sys/stdsyms.h:
(I've put the file at http://azug.minpet.unibas.ch/~pascal/R/stdsyms.h)

# ifdef _FILE_OFFSET_BITS
#  if _FILE_OFFSET_BITS == 64
#    define _FILE64		/* _FILE64 is obsolescent; don't use it */
#    define __64BIT_OFF_T
#    if !defined(__LP64__)
#       define _APP32_64BIT_OFF_T
#    endif 
#  else
#    if _FILE_OFFSET_BITS != 32
	#error "_FILE_OFFSET_BITS defined to invalid number!!"
#    endif
#  endif/* _FILE_OFFSET_BITS == 64 */
# endif /* _FILE_OFFSET_BITS */

Does that mean that the platform include files are broken or is this a problem 
with the way they are included in R? I fear I have no means to change 
the /usr/include/... files on that machine.

Pascal



[Rd] Error compiling on HP-UX
Pascal A. Niklaus