Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consider enabling -Wextra #22

Open
nathanlynch opened this issue Mar 9, 2022 · 0 comments
Open

consider enabling -Wextra #22

nathanlynch opened this issue Mar 9, 2022 · 0 comments

Comments

@nathanlynch
Copy link
Contributor

GCC 11 manual says -Wextra enables:

          -Wclobbered
          -Wcast-function-type
          -Wdeprecated-copy (C++ only)
          -Wempty-body
          -Wenum-conversion (C only)
          -Wignored-qualifiers
          -Wimplicit-fallthrough=3
          -Wmissing-field-initializers
          -Wmissing-parameter-type (C only)
          -Wold-style-declaration (C only)
          -Woverride-init
          -Wsign-compare (C only)
          -Wstring-compare
          -Wredundant-move (only for C++)
          -Wtype-limits
          -Wuninitialized
          -Wshift-negative-value (in C++03 and in C99 and newer)
          -Wunused-parameter (only with -Wunused or -Wall)
          -Wunused-but-set-parameter (only with -Wunused or -Wall)

Adding it to the build yields:

  CC       librtas_src/ofdt.lo
  CC       librtas_src/syscall_calls.lo
librtas_src/syscall_calls.c: In function ‘rtas_physical_attestation’:
librtas_src/syscall_calls.c:1381:33: warning: comparison of integer expressions of different signedness: ‘__uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
 1381 |         if (be32toh(resp_bytes) > *work_area_bytes) {
      |                                 ^
  CC       librtas_src/syscall_rmo.lo
librtas_src/syscall_rmo.c: In function ‘get_phys_region’:
librtas_src/syscall_rmo.c:243:37: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
  243 |                 if ((i * PAGE_SIZE) >= kregion->size)
      |                                     ^~
librtas_src/syscall_rmo.c: In function ‘release_phys_region’:
librtas_src/syscall_rmo.c:292:18: warning: comparison of integer expressions of different signedness: ‘uint64_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
  292 |         if (bits != ((1 << n_pages) - 1)) {
      |                  ^~
  CCLD     librtas.la
  CC       librtasevent_src/get_rtas_event.lo
librtasevent_src/get_rtas_event.c: In function ‘parse_rtas_event’:
librtasevent_src/get_rtas_event.c:411:26: warning: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
  411 |     if (re->event_length > buflen) {
      |                          ^
  CC       librtasevent_src/print_rtas_event.lo
librtasevent_src/print_rtas_event.c: In function ‘print_re_exthdr_scn’:
librtasevent_src/print_rtas_event.c:542:50: warning: unused parameter ‘verbosity’ [-Wunused-parameter]
  542 | print_re_exthdr_scn(struct scn_header *shdr, int verbosity)
      |                                              ~~~~^~~~~~~~~
  CC       librtasevent_src/rtas_cpu.lo
librtasevent_src/rtas_cpu.c: In function ‘print_re_cpu_scn’:
librtasevent_src/rtas_cpu.c:82:47: warning: unused parameter ‘verbosity’ [-Wunused-parameter]
   82 | print_re_cpu_scn(struct scn_header *shdr, int verbosity)
      |                                           ~~~~^~~~~~~~~
  CC       librtasevent_src/rtas_dump.lo
  CC       librtasevent_src/rtas_epow.lo
librtasevent_src/rtas_epow.c: In function ‘print_v4_epow’:
librtasevent_src/rtas_epow.c:95:44: warning: unused parameter ‘verbosity’ [-Wunused-parameter]
   95 | print_v4_epow(struct scn_header *shdr, int verbosity)
      |                                        ~~~~^~~~~~~~~
  CC       librtasevent_src/rtas_io.lo
librtasevent_src/rtas_io.c: In function ‘print_v4_io’:
librtasevent_src/rtas_io.c:97:42: warning: unused parameter ‘verbosity’ [-Wunused-parameter]
   97 | print_v4_io(struct scn_header *shdr, int verbosity)
      |                                      ~~~~^~~~~~~~~
  CC       librtasevent_src/rtas_lri.lo
  CC       librtasevent_src/rtas_mem.lo
librtasevent_src/rtas_mem.c: In function ‘print_re_mem_scn’:
librtasevent_src/rtas_mem.c:78:47: warning: unused parameter ‘verbosity’ [-Wunused-parameter]
   78 | print_re_mem_scn(struct scn_header *shdr, int verbosity)
      |                                           ~~~~^~~~~~~~~
  CC       librtasevent_src/rtas_post.lo
librtasevent_src/rtas_post.c: In function ‘print_re_post_scn’:
librtasevent_src/rtas_post.c:93:48: warning: unused parameter ‘verbosity’ [-Wunused-parameter]
   93 | print_re_post_scn(struct scn_header *shdr, int verbosity)
      |                                            ~~~~^~~~~~~~~
  CC       librtasevent_src/rtas_sp.lo
librtasevent_src/rtas_sp.c: In function ‘print_re_ibmsp_scn’:
librtasevent_src/rtas_sp.c:78:49: warning: unused parameter ‘verbosity’ [-Wunused-parameter]
   78 | print_re_ibmsp_scn(struct scn_header *shdr, int verbosity)
      |                                             ~~~~^~~~~~~~~
  CC       librtasevent_src/rtas_srcfru.lo
librtasevent_src/rtas_srcfru.c: In function ‘print_fru_mr_scn’:
librtasevent_src/rtas_srcfru.c:518:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
  518 |     for (i = 0; i < frumr_num_callouts(fru_mr); i++) {
      |                   ^
  CC       librtasevent_src/rtas_v6_misc.lo
librtasevent_src/rtas_v6_misc.c: In function ‘print_re_generic_scn’:
librtasevent_src/rtas_v6_misc.c:674:51: warning: unused parameter ‘verbosity’ [-Wunused-parameter]
  674 | print_re_generic_scn(struct scn_header *shdr, int verbosity)
      |                                               ~~~~^~~~~~~~~
  CC       librtasevent_src/rtas_vend.lo
librtasevent_src/rtas_vend.c: In function ‘print_re_ibm_diag_scn’:
librtasevent_src/rtas_vend.c:77:52: warning: unused parameter ‘verbosity’ [-Wunused-parameter]
   77 | print_re_ibm_diag_scn(struct scn_header *shdr, int verbosity)
      |                                                ~~~~^~~~~~~~~
librtasevent_src/rtas_vend.c: In function ‘print_re_vend_errlog_scn’:
librtasevent_src/rtas_vend.c:152:55: warning: unused parameter ‘verbosity’ [-Wunused-parameter]
  152 | print_re_vend_errlog_scn(struct scn_header *shdr, int verbosity)
      |                                                   ~~~~^~~~~~~~~

Doesn't seem like too much to fix.

@tyreld tyreld added this to the Release 2.0.4 milestone Aug 18, 2022
@tyreld tyreld removed this from the Release 2.0.4 milestone Apr 19, 2023
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

No branches or pull requests

2 participants