tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: compilers and unused args in functions



    Date:        Fri, 5 Jul 2024 08:00:46 +0200
    From:        Roland Illig <roland.illig%gmx.de@localhost>
    Message-ID:  <c200a2ba-f325-4d3f-bdc3-e95990aa971b%gmx.de@localhost>

  | Do you really need all these functions in a single table?

Yes.   This is for when a variable is set, the var struct has a
function for those few variables that need some special action to
be taken (other than just saving the values).   Everything up to
now just wants to see the new value about to be assigned, but there's
one of them needs to know why the assignment is happening, so it
can act differently.

I could use a different function type, and add a special flag, just for
that one variable, to call a different function, but that would add
tests to every shell var assignment just to handle one special case
which is almost never assigned.

  | If adding the second argument is indeed the best choice, you may need to
  | mark that parameter in all other functions with __unused taken from
  | <sys/cdefs.h>.

Thanks, and to Valery (uwe@) for that pointer, and __USE()  -- I think I
prefer __unused for this, that's simple enough.

kre



Home | Main Index | Thread Index | Old Index