melver wrote:

This LGTM, but I'd like to hear from others more familiar with the history of 
these attributes.

In particular, we'd be diverging from GCC's behaviour, so that users would now 
need to do:
```
#ifdef __clang__
#define __attribute_malloc_span  __attribute__((malloc))
#define __attribute_malloc_size_span(...)  
__attribute__((alloc_size(__VA_ARGS__)))
#else
#define __attribute_malloc_span  
#define __attribute_malloc_size_span(...) 
#endif 
```

IMHO, that's reasonable. Maybe we can ask GCC folks to also permit these 
attributes on functions that return span-like objects.

https://github.com/llvm/llvm-project/pull/165433
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to