summaryrefslogtreecommitdiff
path: root/gdb/c-typeprint.c
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2016-01-25 20:29:54 +0100
committerMark Wielaard <mjw@redhat.com>2016-01-26 00:04:55 +0100
commita579cd9aa8c57c8a54833f26452a1afef38e5d20 (patch)
treec4644afae5892aef7114768ef5bdf2d0ae5e19cb /gdb/c-typeprint.c
parent00acd688caf385f38493ebd8d0a7b5f94d501a79 (diff)
Fix GCC6 -Wmisleading-indentation issues.
GCC6 will warn about misleading indentation issues like: gdb/ada-lang.c: In function ‘ada_evaluate_subexp’: ada-lang.c:11423:9: error: statement is indented as if it were guarded by... arg1 = unwrap_value (arg1); ^~~~ gdb/ada-lang.c:11421:7: note: ...this ‘else’ clause, but it is not else ^~~~ In this case it would be a bug except for the fact the if clause already returned early. So this misindented statement really only got executed for the else case. But it could easily mislead a reader, so adding a proper else block is the correct solution. In case of c-typeprint.c (c_type_print_base) the if statement is indeed misleadingly indented, but not a bug. Just indent correctly. The inflow.c (terminal_ours_1) misindented block comes from the removal of an if clause in commit d9d2d8b which looks correct. Just introduce an else to fixup the indentation of the block. The linux-record.c misleadingly indented return statements are just that. Misleading to the reader, but not actual bugs. Just unindent them so they don't look like they fall under the wrong if clause.
Diffstat (limited to 'gdb/c-typeprint.c')
-rw-r--r--gdb/c-typeprint.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 762c02710f..6b9e6b3cf2 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -1305,27 +1305,27 @@ c_type_print_base (struct type *type, struct ui_file *stream,
if (TYPE_NFIELDS (type) != 0 || TYPE_NFN_FIELDS (type) != 0)
fprintf_filtered (stream, "\n");
- for (i = 0; i < TYPE_TYPEDEF_FIELD_COUNT (type); i++)
- {
- struct type *target = TYPE_TYPEDEF_FIELD_TYPE (type, i);
-
- /* Dereference the typedef declaration itself. */
- gdb_assert (TYPE_CODE (target) == TYPE_CODE_TYPEDEF);
- target = TYPE_TARGET_TYPE (target);
-
- print_spaces_filtered (level + 4, stream);
- fprintf_filtered (stream, "typedef ");
-
- /* We want to print typedefs with substitutions
- from the template parameters or globally-known
- typedefs but not local typedefs. */
- c_print_type (target,
- TYPE_TYPEDEF_FIELD_NAME (type, i),
- stream, show - 1, level + 4,
- &semi_local_flags);
- fprintf_filtered (stream, ";\n");
- }
- }
+ for (i = 0; i < TYPE_TYPEDEF_FIELD_COUNT (type); i++)
+ {
+ struct type *target = TYPE_TYPEDEF_FIELD_TYPE (type, i);
+
+ /* Dereference the typedef declaration itself. */
+ gdb_assert (TYPE_CODE (target) == TYPE_CODE_TYPEDEF);
+ target = TYPE_TARGET_TYPE (target);
+
+ print_spaces_filtered (level + 4, stream);
+ fprintf_filtered (stream, "typedef ");
+
+ /* We want to print typedefs with substitutions
+ from the template parameters or globally-known
+ typedefs but not local typedefs. */
+ c_print_type (target,
+ TYPE_TYPEDEF_FIELD_NAME (type, i),
+ stream, show - 1, level + 4,
+ &semi_local_flags);
+ fprintf_filtered (stream, ";\n");
+ }
+ }
fprintfi_filtered (level, stream, "}");
}