chiark / gitweb /
Add half-hearted support for Clang, because its `blocks' are deficient.
[finally] / FINALLY.3
index a7de5fcfb452a076fb3120663b3155d9dbed7253..1a689c62bad5f3e34eae837273553b3fea893ec1 100644 (file)
--- a/FINALLY.3
+++ b/FINALLY.3
@@ -133,6 +133,27 @@ Use the GNU C Compiler's support for nested functions and the
 function attribute.  Note that this use of nested functions does not
 involve the use of trampolines, and does not require an executable
 stack.  (This is verified as part of the package tests.)
+.TP
+.B CLANG_BLOCKS
+Use the LLVM Clang compiler's support for `blocks' and the
+.B cleanup
+function attribute.  Depending on the environment, this may require the
+.B \-fblocks
+compiler option, and linking against the
+.B \-lBlocksRuntime
+library.
+.IP
+Support is only partial.  When the statement is executed on exit from
+its scope, it sees the variable values that were current when the
+.B FINALLY
+declaration was processed, and not any changes since.  As a result of
+this bug, the
+.B <finally.h>
+header will fail unless the macro
+.B FINALLY_TOLERATE_BUG_CAPTURE_COPIES
+is defined to a nonzero value, and will set
+.B FINALLY_BUG_CAPTURE_COPIES
+for your program to act on.
 .PP
 If
 .B FINALLY_CONFIG_FLAVOUR
@@ -157,6 +178,9 @@ file's internal documentation for the details.
 .
 .SH BUGS
 The selection of supported compilers is extremely limited.
+.PP
+Clang doesn't work properly because its `blocks' capture a copy of the
+outer scope's variables, rather than closing over them properly.
 .
 .SH AUTHOR
 Mark Wooding, <mdw@distorted.org.uk>