]> git.ipfire.org Git - thirdparty/bird.git/commit
C Compiler Attribute Cleanup Test
authorMaria Matejka <mq@ucw.cz>
Thu, 26 Oct 2023 21:09:20 +0000 (23:09 +0200)
committerMaria Matejka <mq@ucw.cz>
Thu, 9 Nov 2023 22:08:21 +0000 (23:08 +0100)
commit980ef11016546ecd409a7f83b33a2f8f758ec926
treea7a2e025745cd7104f78642954dcfad51be45ee4
parent87e2ba8c84a0f8db61da6548082fc6084c96142d
C Compiler Attribute Cleanup Test

There is a long-known CC attribute cleanup which allows to call a custom
cleanup function when an auto-storage variable ceases to exist. We're
gonna use it for end-of-loop and leave-locked-block macros.

This commit adds a static unit test for this compiler feature to be sure
that it really does what we want. We're looking forward to the next ISO
C norm where this may finally get a nice syntax and standardization.
lib/Makefile
lib/attribute_cleanup_test.c [new file with mode: 0644]
lib/birdlib.h