joern
joern copied to clipboard
[Bug][C][C23] Empty methods with `_Noreturn` attribute
Describe the bug Methods with _Noreturn have an empty method body
To Reproduce
#include <stdio.h>
#include <stdlib.h>
static void _Noreturn execute(char **argv) {
printf("Execute");
exit(0);
}
int main(int argc, char **argv) {
execute(argv);
}
// in joern, after importCode():
cpg.method("execute").code.l // empty
Expected behavior The method should not be empty.
Desktop (please complete the following information): Latest joern via docker/nightly (4.0.388)
Not 100% sure but I guess CDT is not able to parse methods with _Noreturn.
You could try to run c2cpg with the --with-include-auto-discovery flag in case _Noreturn is defined in one of the included system headers.