From 8867ae55ad1a4ba48d3413c17af0692a1ddcd9a0 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 16 Feb 2020 01:20:21 +0100 Subject: [PATCH] Clean-up: problematic function signature GCC8 now spots and warns about such mismatches. And we should take such warnings seriously; code produced by the newer GCC versions tends to segfault, especially under -O2 and above, when a return statement is actually missing, even if the return value is actually not used at call site. Here, a functor to unlock the active "guard" is passed into a macro construct, which basically allows to abstract the various kinds of "guards", be it mutex, condition variable or the like. Seemingly, the intention was to deal with a failure when unlocking -- however all the real implementations prefer to kill the whole application without much ado. --- src/lib/sectionlock.h | 2 +- wiki/thinkPad.ichthyo.mm | 30 ++++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/lib/sectionlock.h b/src/lib/sectionlock.h index 1e2f3e056..8ece0da10 100644 --- a/src/lib/sectionlock.h +++ b/src/lib/sectionlock.h @@ -31,7 +31,7 @@ #include -typedef int +typedef void (*lumiera_sectionlock_unlock_fn)(void*, struct nobug_flag* flag, struct nobug_resource_user** handle, const struct nobug_context ctx); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index ede328825..fa8b7458e 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -44943,9 +44943,35 @@ - - + + + + + + + + + + + + + + + + + + + +

+ früher war das so eine typische "nörgel"-Warnung, die man unter den Teppich kehren konnte: 'ey, der Compiler bekommt es ja trotzdem richtig hin. +

+ + +
+ +
+