11219 mdb: smbsrv.c: error: comparison between pointer and integer

Review Request #1988 — Created June 8, 2019 and submitted

tsoome
illumos-gate
11219
9c5aa3a...
general
../../../common/modules/smbsrv/smbsrv.c: In function 'smb_hash_walk_init':
../../../common/modules/smbsrv/smbsrv.c:1926:11: error: comparison between pointer and integer [-Werror]
  if (addr == NULL) {
           ^~
../../../common/modules/smbsrv/smbsrv.c: In function 'smb_hashstat_walk_init':
../../../common/modules/smbsrv/smbsrv.c:2015:11: error: comparison between pointer and integer [-Werror]
  if (addr == NULL) {
           ^~
cc1: all warnings being treated as errors


  • 0
  • 0
  • 8
  • 0
  • 8
Description From Last Updated
gwr
  1. I think we should just wait these until I've got more of the upstreaming done.
    It will be easier for us to merge back these changes if they happen after that.

    1. Actualy, there's not a whole lot more work in mdb after https://github.com/illumos/illumos-gate/pull/55
      so I'll take care of this in that PR.

    2. There is the thing - we are 9 patches away from commiting 11112 sys/null.h: make NULL void *, 394 patches in total. Naturally I would like to get those 9 out of my way and set 1112 on place.

  2. 
      
gwr
  1. 
      
  2. Other places in this code we just use zero.
    I prefer that.

    1. I know the temptation. However, since uintptr_t is pointer represented as unsigned int, the 0 does not make sense there and (uintptr_t)NULL does. Even as the actual value is the same:) Beside, this is the approach used everywhere else.

    2. For the record, I wasn't satisfied with that response.
      I'd have preferred the "when in Rome" rule (do like the surrounding code does).

    3. And no, casts of zero are not "everywhere else".
      From where did you get guidance to do that?

  3. 
      
domag02
  1. Whitespace nits and consistency issues.
  2. Space followed-by tab.
  3. Space followed-by tab.
  4. Should be:

        if (wsp->walk_addr == (uintptr_t)NULL) {
    
  5. Should be:

        if (wsp->walk_addr == (uintptr_t)NULL) {
    
  6. Should be:

        if (wsp->walk_addr == (uintptr_t)NULL) {
    
  7. Should be:

        if (wsp->walk_addr == (uintptr_t)NULL) {
    
  8. Should be:

        if (wsp->walk_addr == (uintptr_t)NULL) {
    
  9. Should be:

        if (wsp->walk_addr == (uintptr_t)NULL) {
    
  10. 
      
tsoome
otis
  1. Ship It!
  2. 
      
citrus
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...