[Rd] Error compiling on HP-UX

Pascal A. Niklaus pascal.niklaus at ipw.agrl.ethz.ch
Tue Dec 19 12:02:20 CET 2006


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



More information about the R-devel mailing list