Skip to content

Commit

Permalink
debugger: Make GCC happy
Browse files Browse the repository at this point in the history
Apparently GCC is not smart enough to understand that when the a NULL
name is passed to `gdb_mi_result_foreach_matched` the `strcmp()` call
cannot possibly happen.  Work around the warnings it emits by adding an
explicit (and useless) check on the `strcmp()` argument, which probably
will be optimized out anyway.
  • Loading branch information
b4n committed Oct 25, 2014
1 parent ca63317 commit 3afcc8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion debugger/src/gdb_mi.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ gboolean gdb_mi_record_matches(const struct gdb_mi_record *record, enum gdb_mi_r

#define gdb_mi_result_foreach_matched(node_, result_, name_, type_) \
gdb_mi_result_foreach ((node_), (result_)) \
if (((name_) != NULL && (! (node_)->var || strcmp((node_)->var, (name_)) != 0)) || \
if (((name_) != NULL && (! (node_)->var || strcmp((node_)->var, (name_) ? (name_) : "") != 0)) || \
((type_) >= 0 && (node_)->val->type != (type_))) \
continue; \
else
Expand Down

0 comments on commit 3afcc8f

Please sign in to comment.