libdemangle: error: variable 'result' might be clobbered by 'longjmp' or 'vfork'
New gcc7 issue was added recently:
../common/cxx.c: In function 'cpp_demangle': ../common/cxx.c:170:8: error: variable 'result' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered] char *result = NULL; ^~~~~~ cc1: all warnings being treated as errors *** Error code 1 dmake: Fatal error: Command failed for target `pics/cxx.o' Current working directory /code/illumos-gate/usr/src/lib/libdemangle/i386 *** Error code 1
The [[https://www.illumos.org/rb/r/1235/]] is proposed fix, also note the test done by Andy to check attribute((malloc)) - it did not fix the issue. Also attribute volatile did not help because passing pointer result to memcpy() did cause the effect to be lost. Which left the only option to use local variable and assignment operator.
Updated by Electric Monk over 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
commit e239895e13556da6878ec1eda7d795ea494fa359 Author: Toomas Soome <firstname.lastname@example.org> Date: 2018-10-15T14:42:24.000Z 9896 libdemangle: error: variable 'result' might be clobbered by 'longjmp' or 'vfork' Reviewed by: Andy Fiddaman <email@example.com> Reviewed by: C Fraire <firstname.lastname@example.org> Reviewed by: Jason King <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>