Promote -Wno-sizeof-array-argument to an error

2024-08-07 Thread Alejandro Colomar via Gcc
Hi Martin,

Can we promote -Wno-sizeof-array-argument to a hard error?  I don't
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

-- 



signature.asc
Description: PGP signature


Re: Promote -Wno-sizeof-array-argument to an error

2024-08-07 Thread Alejandro Colomar via Gcc
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
> 
> -- 
> 



-- 



signature.asc
Description: PGP signature


Custom Float Instructions

2024-08-07 Thread Amit Hiremath
Hello,

I want to add custom single precision floating point sine, cosine, exp
instructions to risc-v gnu tool chain, and I have designed hardware for
this. I was going through tutorials on how to add custom instructions at:
https://pcotret.gitlab.io/riscv-custom/sw_toolchain.html after adding
custom instructions, I think one has to use asm macro to use custom
instructions in C. Is there anyway where one do not need to use this macro?
I would like the compiler to automatically map to custom instructions in
the risc-v processor, like how it will map to fadd.s, fmul.s instructions,
where one does not need to use asm macro.

I asked in riscv gnu tool chain forum about this issue:
https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1526  they
suggested that I ask this query in the gcc forum.

Can you please guide me?

Many Thanks,
-Amith