php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50800 Hashes use improper sign with L64 macro
Submitted: 2010-01-19 17:09 UTC Modified: 2018-09-30 14:13 UTC
From: philipp at redfish-solutions dot com Assigned: cmb (profile)
Status: Closed Package: Compile Warning
PHP Version: 5.2.12 OS: linux 2.6.27.42
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: philipp at redfish-solutions dot com
New email:
PHP Version: OS:

 

 [2010-01-19 17:09 UTC] philipp at redfish-solutions dot com
Description:
------------
The table:

static const php_hash_uint64 rc[R + 1] = {
...
    L64(0xbd5d10f4cb3e0567),
...

uses unsigned data of 64-bit size, but it isn't declared as such. When the high bit is set, as above, this causes warnings (or errors, if -Wall is present).


Reproduce code:
---------------
The fix is trivial.  In the sequence:

#elif SIZEOF_LONG_LONG == 8
#define L64(x) x##LL
typedef unsigned long long php_hash_uint64;

for example, in ext/hash/php_hash_types.h, the macro should be written as:

#define L64(x) x##ULL

instead.



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-09-30 14:13 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2018-09-30 14:13 UTC] cmb@php.net
This should be fixed with commit 14caf17[1], available as of PHP
5.6.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=14caf174ff219376e4f1234bd297ffe973cc416e>
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 04:05:54 2022 UTC