[geany/geany-plugins] 3afcc8: debugger: Make GCC happy

Colomban Wendling git-noreply at xxxxx
Sun Nov 15 17:28:20 UTC 2015


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 25 Oct 2014 21:57:39 UTC
Commit:      3afcc8f56516532810fd3b76ad39697143e58246
             https://github.com/geany/geany-plugins/commit/3afcc8f56516532810fd3b76ad39697143e58246

Log Message:
-----------
debugger: Make GCC happy

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.


Modified Paths:
--------------
    debugger/src/gdb_mi.h

Modified: debugger/src/gdb_mi.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -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



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list