From: Michael Stapelberg Date: Wed, 5 Oct 2016 16:46:33 +0000 (-0700) Subject: Fix _i3_version debugging symbol (#2492) X-Git-Tag: 4.13~20 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3cba06f7b970d34b540c65e10c4cef8a8ced7e57;p=i3%2Fi3 Fix _i3_version debugging symbol (#2492) The idea was to ensure the symbol would always be present. For that, we need __attribute__((used)), not __attribute__((unused)). Further, ensure the variable has static storage, as the used attribute only applies to variables with static storage. See also http://stackoverflow.com/a/29545417/712014 --- diff --git a/src/main.c b/src/main.c index 9373445a..f94a8941 100644 --- a/src/main.c +++ b/src/main.c @@ -189,7 +189,7 @@ static void handle_signal(int sig, siginfo_t *info, void *data) { int main(int argc, char *argv[]) { /* Keep a symbol pointing to the I3_VERSION string constant so that we have * it in gdb backtraces. */ - const char *_i3_version __attribute__((unused)) = i3_version; + static const char *_i3_version __attribute__((used)) = I3_VERSION; char *override_configpath = NULL; bool autostart = true; char *layout_path = NULL;