parameter type conflicts

From: Alex Rousskov <rousskov@dont-contact.us>
Date: Fri, 05 Oct 2007 09:31:09 -0600

Amos,

        I saw your IRC question regarding method parameter types in Squid3. I
would be happy to help. I believe the procedure should be very simple
and mechanic:

1) The parameter type in the child (derived) class virtual method
definition should be exactly the same as the parameter type in the
parent (base) class virtual method definition. If there is a mismatch,
copy the parent type into the child definition.

2) The parameter type in the method definition (.cc file) should be
exactly the same as the parameter type in the method declaration (.h
file). If there is a mismatch, copy the declaration type into the
definition.

3) The same should apply to method's return values, const modifiers, and
non-methods.

In short, declarations should not change and should match definitions.
There are legal exceptions to these rules, but I doubt we should abuse
them in Squid.

If the above procedure yields compile-time errors, we have a bug that
must be fixed. If the above procedure does not apply (e.g., parameters
of non-virtual methods in base and derived classes differ), then a
careful examination of the code is required. Again, I would be happy to
help you with that.

Thank you,

Alex.
Received on Fri Oct 05 2007 - 09:31:18 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Oct 30 2007 - 13:00:03 MDT