Search code examples
clangllvmriscv

clang warning argument unused during compilation for -fsanitize-address-outline-instrumentation


I am trying to test out whether the flag -fsanitize-address-outline-instrumentation works for the LLVM Clang compiler.

Ubuntu clang version 15.0.7

I have created an exemplary program:

main.c

#include "stdio.h"

static inline void printFunc(void)
{
    printf("Test string \r\n");
}

int main(void)
{
    printFunc();

    return 0;
}

I wanted to verify whether the printFunc would be inlined or not, depeneding on whether the -fsanitize-address-outline-instrumentation compilation flag is added. When I try to compile the file, the compiler returns during compilation:

lukasz@lp:/tmp/test$ clang main.c -o main -fsanitize-address-outline-instrumentation
clang: warning: argument unused during compilation: '-fsanitize-address-outline-instrumentation' [-Wunused-command-line-argument]

I cannot figure out why is the parameter ignored.


Solution

  • The proper way for disabling inlining is to use the -fno-inline-functions. But for the inlining to even work in the first place, optimization has to be used, i.e. -O2 or -Oz.