This fixes tool pygrub to build on x86-64 systems. Currently gcc is saying there are incompatible pointer type passed into function ext2fs_file_read. The address of variable n is used in ext2fs_file_read which takes an "unsigned int *" as the 4th variable. "n" is currently declared as an "size_t" which is an "int". This declares n as an "unsigned int" instead of using type "size_t". -- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2005-May-16 21:13 UTC
Re: [Xen-devel] [PATCH] fix tool pygrub build on x64
On Mon, May 16, 2005 at 02:15:33PM -0500, Jerone Young wrote:> This fixes tool pygrub to build on x86-64 systems. Currently gcc is > saying there are incompatible pointer type passed into function > ext2fs_file_read. The address of variable n is used in ext2fs_file_read > which takes an "unsigned int *" as the 4th variable. "n" is currently > declared as an "size_t" which is an "int". This declares n as an > "unsigned int" instead of using type "size_t".size_t is "unsigned long" not "int" -- Vincent Hanquez _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Maybe on i386 but not x86-64. On Mon, 2005-05-16 at 23:13 +0200, Vincent Hanquez wrote:> On Mon, May 16, 2005 at 02:15:33PM -0500, Jerone Young wrote: > > This fixes tool pygrub to build on x86-64 systems. Currently gcc is > > saying there are incompatible pointer type passed into function > > ext2fs_file_read. The address of variable n is used in ext2fs_file_read > > which takes an "unsigned int *" as the 4th variable. "n" is currently > > declared as an "size_t" which is an "int". This declares n as an > > "unsigned int" instead of using type "size_t". > > size_t is "unsigned long" not "int" >-- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ok, To better followup my findings you will see that size_t is of type __kernel_size_t. On i386 in "asm-i386/posix_types.h" you have: typedef unsigned int __kernel_size_t; Where as on x86-64 you in "asm-x86_64/posix_types.h" you have: typedef unsigned long __kernel_size_t; I must have typed "unsigned int" by accident. Sorry. But the fix is still valid. Where as in On Mon, 2005-05-16 at 23:13 +0200, Vincent Hanquez wrote:> On Mon, May 16, 2005 at 02:15:33PM -0500, Jerone Young wrote: > > This fixes tool pygrub to build on x86-64 systems. Currently gcc is > > saying there are incompatible pointer type passed into function > > ext2fs_file_read. The address of variable n is used in ext2fs_file_read > > which takes an "unsigned int *" as the 4th variable. "n" is currently > > declared as an "size_t" which is an "int". This declares n as an > > "unsigned int" instead of using type "size_t". > > size_t is "unsigned long" not "int" >-- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2005-May-16 21:33 UTC
Re: [Xen-devel] [PATCH] fix tool pygrub build on x64
On Mon, May 16, 2005 at 04:22:33PM -0500, Jerone Young wrote:> Maybe on i386 but not x86-64.you can just try the following program and prove that size_t is an unsigned long: int main(int argc, char **argv) { printf("%d\n", sizeof(size_t)); } -- Vincent Hanquez _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Vincent Hanquez
2005-May-16 21:43 UTC
Re: [Xen-devel] [PATCH] fix tool pygrub build on x64
On Mon, May 16, 2005 at 04:28:03PM -0500, Jerone Young wrote:> I must have typed "unsigned int" by accident. Sorry. But the fix is > still valid.sure. I was just nit picking. -- Vincent Hanquez _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel