cjappl wrote:

Possibly another bug here (or user error).

I am trying to see the warnings show up for a simple test program. The clang 
used in this example is the tip of your branch at time of writing 
b95964c2570c11d1d80ae6874be5e400f7b504ad

```cpp
#include <cstdlib>
#include <cstdio>

int* process () [[clang::nonblocking]] 
{


  // THIS MALLOC SHOULD WARN, RIGHT? 
  int* malloced_data = (int*)std::malloc(sizeof(int));


  malloced_data[0] = 7;
  return malloced_data;
}

int main()
{
  int* y = process();
  printf("y[0] = %d\n", y[0]);
  return (int)y[0];
}
```

When I run compile and run this code, it runs, with the proper "7" exit code, 
but does not give me any warnings on compilation.

```
> /Users/topher/code/radsan_cjappl/build/bin/clang++ main.cpp -isysroot 
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.4.sdk
>  -Wfunction-effects -Werror
> ./a.out
y[0] = 7
> echo $?
7
```

I highly suspect I'm doing something wrong, but can't figure out what it might 
be.

https://github.com/llvm/llvm-project/pull/84983
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to