Promote -Wno-sizeof-array-argument to an error
Alejandro Colomar
alx@kernel.org
Thu Aug 8 00:37:35 GMT 2024
On Thu, Aug 08, 2024 at 02:36:36AM GMT, Alejandro Colomar wrote:
> Hi Martin,
>
> Can we promote -Wno-sizeof-array-argument to a hard error? I don't
D'oh! I obviously meant -Wsizeof-array-argument.
> think there's any legitimate use sizeof() on such a parameter.
>
> It would be an incompatible extension to ISO C, which would make sure
> that there are no remaining uses of sizeof(array_param), which would
> itself allow in the future --if n2906 or something similar is accepted--
> repurposing sizeof() to return the size in bytes of the array (instead
> of the size of a pointer) without worrying about breaking existing code.
>
> Any opinions?
>
> Have a lovely night!
> Alex
>
> --
> <https://www.alejandro-colomar.es/>
--
<https://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20240808/ff0b3f20/attachment.sig>
More information about the Gcc
mailing list