php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54912 filter/logical_filters.c:685:32: warning: use of logical || with constant op.
Submitted: 2011-05-24 05:30 UTC Modified: 2011-05-25 00:24 UTC
From: crrodriguez at opensuse dot org Assigned: felipe (profile)
Status: Closed Package: Filter related
PHP Version: 5.3SVN-2011-05-24 (SVN) OS: All
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: crrodriguez at opensuse dot org
New email:
PHP Version: OS:

 

 [2011-05-24 05:30 UTC] crrodriguez at opensuse dot org
Description:
------------
Hi:

There is some buggy/supicious code:

./ext/filter/logical_filters.c:685:32: warning: use of logical || with constant 
operand; switch to bitwise | or remove constant [-Wconstant-logical-operand]                                                          
        if (flags & (FILTER_FLAG_IPV4 || FILTER_FLAG_IPV6)) {
                                      ^  ~~~~~~~~~~~~~~~~

Test script:
---------------
Attached is a patch to clear the problem separating it in two operations.

Expected result:
----------------
No warning

Actual result:
--------------
./ext/filter/logical_filters.c:685:32: warning: use of logical || with constant 
operand; switch to bitwise | or remove constant [-Wconstant-logical-operand] 

Patches

ext-filter-bug (last revision 2011-05-24 03:31 UTC by crrodriguez at opensuse dot org)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-25 00:24 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=311402
Log: - Fixed bug #54912 (filter/logical_filters.c:685:32: warning: use of logical || with constant op)
  Initial patch by: crrodriguez at opensuse dot org
 [2011-05-25 00:24 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2011-05-25 00:24 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2011-05-25 00:34 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=311403
Log: - Fix logic, it must check for both flags (as says the comment in the code) (bug #54912)
 [2012-04-18 09:50 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b28294acc24256d123c65dd3a358145e52260e62
Log: - Fixed bug #54912 (filter/logical_filters.c:685:32: warning: use of logical || with constant op)   Initial patch by: crrodriguez at opensuse dot org
 [2012-07-24 23:41 UTC] rasmus@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b28294acc24256d123c65dd3a358145e52260e62
Log: - Fixed bug #54912 (filter/logical_filters.c:685:32: warning: use of logical || with constant op)   Initial patch by: crrodriguez at opensuse dot org
 [2013-11-17 09:38 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b28294acc24256d123c65dd3a358145e52260e62
Log: - Fixed bug #54912 (filter/logical_filters.c:685:32: warning: use of logical || with constant op)   Initial patch by: crrodriguez at opensuse dot org
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 06 20:01:27 2024 UTC