[PATCH] D126864: [clang] Introduce -fstrict-flex-arrays for stricter handling of flexible arrays
    serge via Phabricator via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Mon Jun 13 00:25:54 PDT 2022
    
    
  
serge-sans-paille marked 4 inline comments as done.
serge-sans-paille added inline comments.
================
Comment at: clang/test/CodeGen/object-size-flex-array.c:34
+  // CHECK: ret i32 %
+  // CHECK-STRICT: ret i32 %
+  return OBJECT_SIZE_BUILTIN(f->c, 1);
----------------
kees wrote:
> Shouldn't this explicitly return -1?
There's still the possibility that llvm folds that to an actual constant if it can track the allocation site (not the case for that particular function, but I think that's not for clang to decide that)
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126864/new/
https://reviews.llvm.org/D126864
    
    
More information about the cfe-commits
mailing list