Project

General

Profile

Actions

Bug #14336

closed

elfdump: this 'if' clause does not guard...

Added by Toomas Soome 8 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Build errors with gcc 11:

    ../common/elfdump.c: In function 'dynamic32':
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3032:17: note: in expansion of macro 'GRAB'
     3032 |                 GRAB(SHT_SYMTAB,        symtab);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3032:17: note: in expansion of macro 'GRAB'
     3032 |                 GRAB(SHT_SYMTAB,        symtab);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3033:17: note: in expansion of macro 'GRAB'
     3033 |                 GRAB(SHT_DYNSYM,        dynsym);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3033:17: note: in expansion of macro 'GRAB'
     3033 |                 GRAB(SHT_DYNSYM,        dynsym);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3034:17: note: in expansion of macro 'GRAB'
     3034 |                 GRAB(SHT_FINI_ARRAY,    fini_array);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3034:17: note: in expansion of macro 'GRAB'
     3034 |                 GRAB(SHT_FINI_ARRAY,    fini_array);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3035:17: note: in expansion of macro 'GRAB'
     3035 |                 GRAB(SHT_HASH,          hash);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3035:17: note: in expansion of macro 'GRAB'
     3035 |                 GRAB(SHT_HASH,          hash);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3036:17: note: in expansion of macro 'GRAB'
     3036 |                 GRAB(SHT_INIT_ARRAY,    init_array);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3036:17: note: in expansion of macro 'GRAB'
     3036 |                 GRAB(SHT_INIT_ARRAY,    init_array);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3037:17: note: in expansion of macro 'GRAB'
     3037 |                 GRAB(SHT_SUNW_move,     sunw_move);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3037:17: note: in expansion of macro 'GRAB'
     3037 |                 GRAB(SHT_SUNW_move,     sunw_move);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3038:17: note: in expansion of macro 'GRAB'
     3038 |                 GRAB(SHT_PREINIT_ARRAY, preinit_array);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3038:17: note: in expansion of macro 'GRAB'
     3038 |                 GRAB(SHT_PREINIT_ARRAY, preinit_array);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3039:17: note: in expansion of macro 'GRAB'
     3039 |                 GRAB(SHT_SUNW_cap,      sunw_cap);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3039:17: note: in expansion of macro 'GRAB'
     3039 |                 GRAB(SHT_SUNW_cap,      sunw_cap);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3040:17: note: in expansion of macro 'GRAB'
     3040 |                 GRAB(SHT_SUNW_capinfo,  sunw_capinfo);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3040:17: note: in expansion of macro 'GRAB'
     3040 |                 GRAB(SHT_SUNW_capinfo,  sunw_capinfo);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3041:17: note: in expansion of macro 'GRAB'
     3041 |                 GRAB(SHT_SUNW_capchain, sunw_capchain);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3041:17: note: in expansion of macro 'GRAB'
     3041 |                 GRAB(SHT_SUNW_capchain, sunw_capchain);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3042:17: note: in expansion of macro 'GRAB'
     3042 |                 GRAB(SHT_SUNW_LDYNSYM,  sunw_ldynsym);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3042:17: note: in expansion of macro 'GRAB'
     3042 |                 GRAB(SHT_SUNW_LDYNSYM,  sunw_ldynsym);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3043:17: note: in expansion of macro 'GRAB'
     3043 |                 GRAB(SHT_SUNW_syminfo,  sunw_syminfo);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3043:17: note: in expansion of macro 'GRAB'
     3043 |                 GRAB(SHT_SUNW_syminfo,  sunw_syminfo);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3044:17: note: in expansion of macro 'GRAB'
     3044 |                 GRAB(SHT_SUNW_symsort,  sunw_symsort);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3044:17: note: in expansion of macro 'GRAB'
     3044 |                 GRAB(SHT_SUNW_symsort,  sunw_symsort);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3045:17: note: in expansion of macro 'GRAB'
     3045 |                 GRAB(SHT_SUNW_tlssort,  sunw_tlssort);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3045:17: note: in expansion of macro 'GRAB'
     3045 |                 GRAB(SHT_SUNW_tlssort,  sunw_tlssort);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3046:17: note: in expansion of macro 'GRAB'
     3046 |                 GRAB(SHT_SUNW_verdef,   sunw_verdef);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3046:17: note: in expansion of macro 'GRAB'
     3046 |                 GRAB(SHT_SUNW_verdef,   sunw_verdef);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3047:17: note: in expansion of macro 'GRAB'
     3047 |                 GRAB(SHT_SUNW_verneed,  sunw_verneed);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3047:17: note: in expansion of macro 'GRAB'
     3047 |                 GRAB(SHT_SUNW_verneed,  sunw_verneed);
          |                 ^~~~
    ../common/elfdump.c:3029:25: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
     3029 |                         if (sec._sec_field == NULL) \
          |                         ^~
    ../common/elfdump.c:3048:17: note: in expansion of macro 'GRAB'
     3048 |                 GRAB(SHT_SUNW_versym,   sunw_versym);
          |                 ^~~~
    ../common/elfdump.c:3031:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
     3031 |                                 break
          |                                 ^~~~~
    ../common/elfdump.c:3048:17: note: in expansion of macro 'GRAB'
     3048 |                 GRAB(SHT_SUNW_versym,   sunw_versym);
          |                 ^~~~
    cc1: all warnings being treated as errors

Testing done: build/install/boot, using elfdump on various files, appears to work as expected. wsdiff is only reporting debug info differences.

Actions #1

Updated by Electric Monk 8 months ago

  • Gerrit CR set to 1892
Actions #2

Updated by Toomas Soome 7 months ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk 7 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 48f0b85934bda8ceb1816a9b7d27b697dbb40aeb

commit  48f0b85934bda8ceb1816a9b7d27b697dbb40aeb
Author: Toomas Soome <tsoome@me.com>
Date:   2022-01-06T16:17:23.000Z

    14336 elfdump: this 'if' clause does not guard...
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF