[Ocfs2-test-devel] [REPORT] splice_test.h: conflicting types for ‘splice' comes again

tristan.ye tristan.ye at oracle.com
Sun Apr 12 21:56:36 PDT 2009


On Mon, 2009-04-13 at 02:21 +0800, Coly Li wrote:
> Several days passed since last time I observed the splice conflicted definition
> and submitted a patch[1]. Today I saw the same error again.
> 
> This time, I pull the code up-to-date, run autogen.sh and make. The similar
> error comes:
> make -C splice
> make[2]: Entering directory `/root/ocfs2-test/programs/splice'
> gcc -O2 -Wall -g       -MD -MP -MF ./.splice_read.d -o splice_read.o -c
> splice_read.c
> In file included from splice_read.c:2:
> splice_test.h:34: error: conflicting types for ‘splice’
> /usr/include/bits/fcntl.h:244: error: previous declaration of ‘splice’ was here
> make[2]: *** [splice_read.o] Error 1
> make[2]: Leaving directory `/root/ocfs2-test/programs/splice'
> make[1]: *** [splice] Error 2
> make[1]: Leaving directory `/root/ocfs2-test/programs'
> make: *** [programs] Error 2
> 
> I past the whole compile log on: http://nopaste.com/p/aRz7tukuc , will be
> available for several days.
> 
> Can anybody reproduce the issue ?
> 
> Thanks.
> 

Coly, 

I remembered you passed the compilation last time without modifying the
src a bit, but just by a refresh 'autogen':)?

Such a compiling error may have something to do with your enviornment.
under my development env,  the splice() defined in bits/fcntl.h like
following,

/* Splice two files together.  */
extern int splice (int __fdin, __off64_t *__offin, int __fdout,
                   __off64_t *__offout, size_t __len, unsigned int
__flags)
    __THROW;

And in our ocfs2-test/splice/splice_test.h, such declaration as follows,
int splice(int fdin, loff_t *off_in, int fdout,
                         loff_t *off_out, size_t len, unsigned int
flags)

We saw the only thing could potentially casue the conflicting type error
is the difference between 'loff_t' and '__off64_t', in my testing env,
such two data type were perfectly the same as we can prove this by
observing file bits/types.h:

typedef __off64_t __loff_t;     /* Type of file sizes and offsets (LFS).
*/

And that's also why most of us will not likely to hit such error!

Would you please paste the corresponding codes as described above from
bits/fcntl.h and bits/types.h to see what's happening in your testing
env? not sure why loff_t and __off64_t were different in your env.

I guess it's safe to use 'loff_t' in original splice_test.h without any
patch needed:)



Regards,
Tristan


> 
> Reference:
> [1]: [PATCH] splice: fix splice() conflicted definitions
>      http://oss.oracle.com/pipermail/ocfs2-test-devel/2009-March/000252.html
> 
> 




More information about the Ocfs2-test-devel mailing list