On Tue, Sep 09, 2025 at 12:13:19AM +0200, Martin Uecker wrote:
> Sorry, example should have been this:
> 
> typedef int arr_t[];
> typedef int arr3_t[3];
>  
> void f(arr3_t*);
> 
> void g(void (*fp)(arr_t*)) {
>   
>       int a[3];
>       (*fp)(&a);      // this call would fail?
> }
> 
> int h()
> {
>   g(&f);
> }

Yes, that would fail. It's a pointer to an array of 3 ints, and that's
fine for distinguishing mismatched callers:

  void(arr3_t*) -> void(int(*)[3]) -> _ZTSFvPA3_iE
  void(arr_t*)  -> void(int(*)[])  -> _ZTSFvPA_iE

How should I adjust this patch's description to say the mangling may
follow a stricter type system?

-Kees

-- 
Kees Cook

Reply via email to