Skip to content

Conversation

esabol
Copy link
Member

@esabol esabol commented Nov 20, 2022

In my testing on Alpine 3.13 (which has gcc 10.2.1) and 3.17 (which has gcc 12.2.1), the following warning was printed during the builds:

  CXX      libgearman-server/plugins/protocol/http/libgearman_server_la-protocol.lo
libgearman-server/plugins/protocol/http/protocol.cc: In member function 'virtual size_t HTTPtext::pack(const gearmand_packet_st*, gearman_server_con_st*, void*, size_t, gearmand_error_t&)':
libgearman-server/plugins/protocol/http/protocol.cc:153:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
  153 |       gearmand_log_debug(GEARMAN_DEFAULT_LOG_PARAM,
      |       ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
  154 |                          "Bad packet command: gearmand_command_t:%s",
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  155 |                          gearman_strcommand(packet->command));
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libgearman-server/plugins/protocol/http/protocol.cc:157:5: note: here
  157 |     case GEARMAN_COMMAND_WORK_FAIL:
      |     ^~~~

This pull request address this by ignoring -Wimplicit-fallthrough in libgearman-server/plugins/protocol/http/protocol.cc.

I used a variation on the Dockerfile in this comment with the modified server.cc file to test these changes.

@esabol esabol force-pushed the ignore-implicit-fallthrough-warning branch from 9a38639 to 04ab8a9 Compare November 20, 2022 02:07
@SpamapS
Copy link
Member

SpamapS commented Nov 20, 2022

Wow quite the pragma block

@SpamapS SpamapS merged commit c5bfad1 into gearman:master Nov 20, 2022
@esabol esabol deleted the ignore-implicit-fallthrough-warning branch November 20, 2022 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants