Bug 39064 - libiberty md5.h needs uintptr_t
Summary: libiberty md5.h needs uintptr_t
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.4.0
: P3 trivial
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 46464 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-01 16:56 UTC by Ozkan Sezer
Modified: 2013-01-30 17:00 UTC (History)
4 users (show)

See Also:
Host:
Target: x86_64-pc-mingw32
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-02-21 09:53:55


Attachments
libiberty md5.h win64 patch (544 bytes, patch)
2009-02-01 16:57 UTC, Ozkan Sezer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ozkan Sezer 2009-02-01 16:56:47 UTC
md5.h of libiberty assumes unsigned long to be of equal size to the size
of a pointer, but that isn't true for all sys tems (ie. win64). this patch
is a workaround for that, probably ugly, but md5.h should include stdint.h
not for _LIBC only..  here is the generated warning:
../../../gcc-svn/libiberty/md5.c: In function 'md5_process_bytes':
../../../gcc-svn/libiberty/md5.c:234: warning: cast from pointer to integer of different size

(the patch should also be applied to binutils and gdb, or whoever else uses
libiberty)
Comment 1 Ozkan Sezer 2009-02-01 16:57:23 UTC
Created attachment 17223 [details]
libiberty md5.h win64 patch
Comment 3 Ozkan Sezer 2009-09-03 10:10:03 UTC
The discussion thread at http://gcc.gnu.org/ml/gcc-patches/2009-03/msg00778.html still haven't provide a solution for this one even after the recent build system changes..  Will md5.h, splay-tree.h and sha1.h be modified to use autotools support, or, should the suggested patch be applied to md5.h?
Comment 4 nightstrike 2010-11-17 13:13:44 UTC
*** Bug 46464 has been marked as a duplicate of this bug. ***
Comment 5 Kai Tietz 2013-01-30 16:51:03 UTC
Author: ktietz
Date: Wed Jan 30 16:50:49 2013
New Revision: 195579

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195579
Log:
	PR other/54620
	PR target/39064
	* md5.h (md5_uintptr, md5_uint32): Define as uintptr_t/uint32_t if
	stdint.h and sys/types.h headers are present.
	* sha1.h (sha1_uintptr, sha1_uint32): Likewise.


Modified:
    trunk/include/ChangeLog
    trunk/include/md5.h
    trunk/include/sha1.h
Comment 6 Kai Tietz 2013-01-30 16:56:50 UTC
Author: ktietz
Date: Wed Jan 30 16:56:36 2013
New Revision: 195580

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195580
Log:
2013-01-30  Kai Tietz  <ktietz@redhat.com>

	PR other/54620
	PR target/39064
	* md5.h (md5_uintptr, md5_uint32): Define as uintptr_t/uint32_t if
	stdint.h and sys/types.h headers are present.
	* sha1.h (sha1_uintptr, sha1_uint32): Likewise.


Modified:
    branches/gcc-4_7-branch/include/ChangeLog
    branches/gcc-4_7-branch/include/md5.h
    branches/gcc-4_7-branch/include/sha1.h
Comment 7 Kai Tietz 2013-01-30 16:58:22 UTC
Author: ktietz
Date: Wed Jan 30 16:58:10 2013
New Revision: 195581

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195581
Log:
	PR other/54620
	PR target/39064
	* md5.h (md5_uintptr, md5_uint32): Define as uintptr_t/uint32_t if
	stdint.h and sys/types.h headers are present.
	* sha1.h (sha1_uintptr, sha1_uint32): Likewise.


Modified:
    branches/gcc-4_6-branch/include/ChangeLog
    branches/gcc-4_6-branch/include/md5.h
    branches/gcc-4_6-branch/include/sha1.h
Comment 8 Kai Tietz 2013-01-30 17:00:12 UTC
Fixed