apache / trafficserver

Apache Traffic Serverâ„¢ is a fast, scalable and extensible HTTP/1.1 and HTTP/2 compliant caching proxy server.
https://trafficserver.apache.org/
Apache License 2.0
1.74k stars 781 forks source link

Fix unused parameters in iocore #11452

Closed freak82 closed 1 week ago

freak82 commented 2 weeks ago

Use /* name ATS_UNUSED */ for fully unused parameters. Use [[maybe_unused]] for conditionally unused parameters.

This pull request is part of the effort for removing the -Wno-unused-parameter warning suppression.

JosiahWI commented 2 weeks ago

Looks like the len parameter in RamCacheLRU::put is used in a debug call.

freak82 commented 2 weeks ago

@JosiahWI You are right. Thank you. I forgot to build the project in Debug mode. Now it should be OK.

freak82 commented 1 week ago

@JosiahWI I can remove them by the end of this week. Should I wait for another approval to remove them or I can just do it?

JosiahWI commented 1 week ago

@freak82 Since the goal of this PR is to move towards removing the -Wno-unused-parameter suppression, we would be fine with merging this as-is. If you would like to go ahead and remove the parameters, you can do so right away, in this PR or in a separate one. If you'd rather not, I have time to remove them myself in a separate PR. What would you prefer?

freak82 commented 1 week ago

One additional question. The functions which accept SSL parameter are called, at least few that I checked, by other functions which also accept such parameter, etc. Should I remove this parameter from all levels of the call-stack? The changes may spread to lots of files depending on the call-stacks.

JosiahWI commented 1 week ago

Thanks for asking about this. It should be fine. Some of them are in SSL callbacks that require the parameter, so you probably won't need to remove them in very many places, but they might need to be marked with ATS_UNUSED in some of these callbacks.

freak82 commented 1 week ago

@JosiahWI The requested parameters were completely removed. Hopefully I didn't miss something.

JosiahWI commented 1 week ago

The AuTest slice_prefetch failed.

        Reason: File differences
         Gold File : /home/jenkins/workspace/Github_Builds/autest/src/tests/gold_tests/pluginTest/slice/gold/slice_prefetch.gold
         Data File : /tmp/sandbox/slice_prefetch/ts/log/cache.log
           bytes 0-6/18 miss
           bytes 7-13/18 miss
           bytes 14-17/18 miss
           bytes 14-17/18 hit-fresh
           - miss, none
           bytes 0-6/18 hit-fresh
           bytes 7-13/18 hit-fresh
           bytes 14-17/18 hit-fresh
           - hit-fresh, none
         - bytes 0-6/18 hit-stale
         - bytes ``/18 hit-stale
         - bytes ``/18 hit-stale
         - bytes 14-17/18 hit-fresh
         - - hit-stale, none
         - bytes 0-6/18 hit-fresh
         - bytes 7-13/18 hit-fresh
         - bytes 14-17/18 hit-fresh
         - bytes 0-17/18 hit-fresh, none
         - bytes 0-4/18 miss
         - bytes ``/18 miss
         - bytes ``/18 miss
         - bytes ``/18 miss
         - bytes 15-17/18 hit-fresh
         - bytes 5-16/18 miss, none
         - bytes 0-6/18 hit-fresh
         - */18 hit-fresh, none
cmcfarlen commented 1 week ago

Cherry-picked to v10.0.x