icing / mod_h2

HTTP/2 module for Apache httpd
https://icing.github.io/mod_h2/
Apache License 2.0
256 stars 41 forks source link

Remove unused leave_ctx from h2_beam_lock structure and adjust callers. #193

Closed notroj closed 4 years ago

notroj commented 4 years ago

Not sure why but I'm seeing gcc 10 warnings on s390x (only) for this.

h2_bucket_beam.c: In function 'h2_beam_abort':
h2_bucket_beam.c:222:9: error: 'bl.leave_ctx' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  222 |         pbl->leave(pbl->leave_ctx, pbl->mutex);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
h2_bucket_beam.c:710:18: note: 'bl.leave_ctx' was declared here
  710 |     h2_beam_lock bl;
      |                  ^~
h2_bucket_beam.c: In function 'h2_beam_close':
h2_bucket_beam.c:222:9: error: 'bl.leave_ctx' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  222 |         pbl->leave(pbl->leave_ctx, pbl->mutex);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
notroj commented 4 years ago

Alternative seems to be to always NULL-initialize the field in mutex_enter but looks like this is never used anyway, so thought I'd propose this first. Can adjust to initialize if preferred, let me know.

icing commented 4 years ago

Looks gtm!