[clang] [Clang][Sema] Allow counted_by on void* as GNU extension (PR #164737)

Kees Cook via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 6 12:16:30 PST 2025


================
@@ -272,6 +286,11 @@ GetCountedByAttrOnIncompletePointee(QualType Ty, NamedDecl **ND) {
   if (!PointeeTy->isIncompleteType(ND))
     return {};
 
+  // If counted_by is on void*, it was already validated at declaration time
+  // as a GNU extension. No need to re-check GNU mode here.
----------------
kees wrote:

Ah yes, this isn't a useful comment any more. I will drop this.

https://github.com/llvm/llvm-project/pull/164737


More information about the cfe-commits mailing list