11275 gettimeofday should use comm page

Review Request #2020 — Created June 25, 2019 and submitted

rm
illumos-gate
master
11275
general

11275 gettimeofday should use comm page
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>



  • 3
  • 0
  • 0
  • 0
  • 3
Description From Last Updated
Argument tz is unused, please use the __unused attribute on that. . . . #include <sys/ccompile.h> . . . int ... domag02 domag02
Same. domag02 domag02
Typo: 's/fasttrop/fasttrap/' domag02 domag02
andy_js
  1. Ship It!
  2. 
      
gdamore
  1. Ship It!
  2. 
      
citrus
  1. Ship It!
  2. 
      
domag02
  1. Missing __unused attribute and a typo in the comment.

  2. usr/src/cmd/sgs/rtld/common/external.c (Diff revision 1)
     
     
     

    Argument tz is unused, please use the __unused attribute on that.

    .
    .
    .
    #include <sys/ccompile.h>
    .
    .
    .
    int
    gettimeofday(struct timeval *tv, void *tz __unused)
    
    1. There's no requirement that we mark every unused variable this way. I honestly don't think it's worthwhile. This warning is particularly annoying especially because of how it interacts with things where the function signature has optional requirements. If we're actually going to require this be the case, then it must be required universally and automatically checked in my opinion.
    2. Historically this was checked via lint. I'm not sure __unused is universal.

      The other way to mark this is with _NOTE(ARGUNUSED(tz)) which is what I prefer, because we have compiler logic that does the right thing here, but if your compiler lacks it, then it gets elided from the code.

  3. Typo:

    's/fasttrop/fasttrap/'
    
  4. 
      
rm
rm
Review request changed

Status: Closed (submitted)

Loading...