]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
log: segv in a portable way 7790/head
authorKefu Chai <kchai@redhat.com>
Thu, 25 Feb 2016 04:19:06 +0000 (12:19 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 26 Feb 2016 07:19:45 +0000 (15:19 +0800)
commitc05300b182f007695ef792bcd45e24bc1d5330d4
treedddf73314e205a5ca4a4d021f6a4f2dd484805a2
parent86e2987fcf39b2329f2393cf50cfafe62538c861
log: segv in a portable way

this piece of code creates a SEGV from logging code to verify a
bug fix at e3fe18a.

clang will delete the null-referencing code. so we need to either
- pass -Wnonull-dereference to $(CC)
- or use  __builtin_trap() offered by GCC/clang
- or use `volatile`
seems volatile is easier and probably more portable.

Fixes: #14856
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/log/Log.cc