Closed
Description
[This is a BUG]
Looks like checkedc-clang does not support preprocessor constants:
Consider the following code:
#include<stdio_checked.h>
void log_write(_Ptr<const char> func) {
char pre[256];
snprintf(pre, sizeof(pre), "%s", func);
printf("%s", pre);
}
int main(void) {
log_write("This Works");
log_write(__func__);
}
$ clang -c pre.c
pre.c:9:14: error: expression has unknown bounds, cast to ptr<T> expects source to have bounds
log_write(__func__);
^~~~~~~~
1 error generated.
Note that, log_write("This Works");
checks out.