27 lines
883 B
C
27 lines
883 B
C
|
|
/*
|
||
|
|
* NEGATIVE COMPILE TEST -- TODO.md section 1.9.
|
||
|
|
*
|
||
|
|
* This file must NOT compile. It is built by the CTest entry `negative_noignore`
|
||
|
|
* with -Werror, and that test is marked WILL_FAIL, so a successful build is a
|
||
|
|
* test failure.
|
||
|
|
*
|
||
|
|
* What it asserts: AKERR_NOIGNORE is actually attached and actually effective.
|
||
|
|
* Every entry point in this library returns an error context the caller must
|
||
|
|
* look at, and the whole design rests on discarding one being hard rather than
|
||
|
|
* merely inadvisable. AKERR_NOIGNORE expands to warn_unused_result, which does
|
||
|
|
* nothing at all if it is dropped from a declaration during a refactor -- and
|
||
|
|
* nothing about the resulting library would look wrong.
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include <akstdlib.h>
|
||
|
|
|
||
|
|
int main(void)
|
||
|
|
{
|
||
|
|
void *ptr = NULL;
|
||
|
|
|
||
|
|
/* Discarding the returned context. This is the line that must not build. */
|
||
|
|
aksl_malloc(32, &ptr);
|
||
|
|
|
||
|
|
return 0;
|
||
|
|
}
|