> **Warning: Non-portable format specifier**
> 
> In `roc_npa_debug.c`, function `npa_halo_dump()`:
> ```c
> npa_dump("W9: thresh \t\t%lu\nW9: fc_msh_dst \t\t%d",
>          (unsigned long)halo->thresh, halo->fc_msh_dst);
> ```
> 
> The AGENTS.md specifies:
> > Forbidden: `%lld`, `%llu`, `%llx` → Preferred: `%PRId64`, `%PRIu64`,
> `%PRIx64`
> 
> While `%lu` with an explicit cast is technically different, for
> consistency with the rest of the file (which uses `%"PRIx64"`
> patterns), this should use:
> ```c
> npa_dump("W9: thresh \t\t%" PRIu64 "\nW9: fc_msh_dst \t\t%d",
>          (uint64_t)halo->thresh, halo->fc_msh_dst);
> ```

I'm not sure I agree with this, because the AI suggested fix casts halo->thresh 
to 64 bit on 32 bit architectures (which there is no need for).

Reply via email to