Project

General

Profile

Bug #8323

ndmpd: left shift of the negative value

Added by Toomas Soome over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2017-06-04
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

Build issue from gcc 6:

tlm/tlm_bitmap.c: In function 'bmp_set':
tlm/tlm_bitmap.c:80:29: error: left shift of negative value [-Werror=shift-negative-value]
 #define BMAP_BPW_MASK (~(~0 << BMAP_BPW_SHIFT))
                             ^
tlm/tlm_bitmap.c:328:20: note: in expansion of macro 'BMAP_BPW_MASK'
   mask = 1 <<(bn & BMAP_BPW_MASK);
                    ^~~~~~~~~~~~~
tlm/tlm_bitmap.c:80:29: error: left shift of negative value [-Werror=shift-negative-value]
 #define BMAP_BPW_MASK (~(~0 << BMAP_BPW_SHIFT))
                             ^
tlm/tlm_bitmap.c:330:20: note: in expansion of macro 'BMAP_BPW_MASK'
   v = (*vp <<(bn & BMAP_BPW_MASK)) & mask;
                    ^~~~~~~~~~~~~
tlm/tlm_bitmap.c: In function 'bmp_get':
tlm/tlm_bitmap.c:80:29: error: left shift of negative value [-Werror=shift-negative-value]
 #define BMAP_BPW_MASK (~(~0 << BMAP_BPW_SHIFT))
                             ^
tlm/tlm_bitmap.c:353:19: note: in expansion of macro 'BMAP_BPW_MASK'
   bit = 1 <<(bn & BMAP_BPW_MASK);
                   ^~~~~~~~~~~~~
tlm/tlm_bitmap.c: In function 'dbmp_set':
tlm/tlm_bitmap.c:80:29: error: left shift of negative value [-Werror=shift-negative-value]
 #define BMAP_BPW_MASK (~(~0 << BMAP_BPW_SHIFT))
                             ^
tlm/tlm_bitmap.c:861:20: note: in expansion of macro 'BMAP_BPW_MASK'
   mask = 1 <<(bn & BMAP_BPW_MASK);
                    ^~~~~~~~~~~~~
tlm/tlm_bitmap.c:80:29: error: left shift of negative value [-Werror=shift-negative-value]
 #define BMAP_BPW_MASK (~(~0 << BMAP_BPW_SHIFT))
                             ^
tlm/tlm_bitmap.c:863:20: note: in expansion of macro 'BMAP_BPW_MASK'
   v = (*vp <<(bn & BMAP_BPW_MASK)) & mask;
                    ^~~~~~~~~~~~~
tlm/tlm_bitmap.c: In function 'dbmp_get':
tlm/tlm_bitmap.c:80:29: error: left shift of negative value [-Werror=shift-negative-value]
 #define BMAP_BPW_MASK (~(~0 << BMAP_BPW_SHIFT))
                             ^
tlm/tlm_bitmap.c:899:19: note: in expansion of macro 'BMAP_BPW_MASK'
   bit = 1 <<(bn & BMAP_BPW_MASK);
                   ^~~~~~~~~~~~~
cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk about 2 years ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit d21cedec4ed074c3a6feb4a8a007a9cb83cca060

commit  d21cedec4ed074c3a6feb4a8a007a9cb83cca060
Author: Toomas Soome <tsoome@me.com>
Date:   2017-06-21T19:48:03.000Z

    8323 ndmpd: left shift of the negative value
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Yuri Pankov <yuripv@gmx.com>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF