On Mon, Feb 17, 2020 at 3:48 PM Jakub Jelinek <ja...@redhat.com> wrote:
>
> On Mon, Feb 17, 2020 at 03:44:53PM +0100, Martin Liška wrote:
> > +      error ("MALLOC attribute set on a void function");
>
> Why the capitals?  Either malloc or %<malloc%> IMSHO.
> What is special about void functions, missing lhs?  That can be missing
> for other functions (where you just don't use the return value, or e.g.
> noreturn even if you do)?  And otherwise, shouldn't the test be rather
> whether the return type is a pointer type?  E.g. float or int return
> type for malloc attribute isn't very meaningful.

It surely would be better if the expansion code would deal with a
"bogus" ECF_MALLOC (ERF_RETURNS_ARG is probably another candidate
that can get "wrong" ...).  But it doesn't seem as easy as fixing the segfault
(see the PR, somehow we fail to emit some insns).

Richard.

>         Jakub
>

Reply via email to