Re: two xasserts in squid3

From: Amos Jeffries <squid3@dont-contact.us>
Date: Tue, 12 Feb 2008 10:44:46 +1300 (NZDT)

> On Mon, 2008-02-11 at 10:15 +1300, Amos Jeffries wrote:
>
>> I think a better approach to this would be:
>>
>> 1) do we actually need it anyway?
>
> Yes, we need a common assert-like macro.
>
>> 2) where is it supposed to be defined?
>
> IMO:
>
> include/xassert.h if xassert is used outside of src/
>
> src/xassert.h otherwise, until we get something like src/base/ or
> src/misc for general-purpose commonly used things that do not fit
> anywhere else.
>
>> I'm willing to commit time to that if we can agree on the 'old' files
>> that need removing and the scope of the remining ones.
>> I have seen a few things that made me think squid.h and defines.h may
>> need to (merge?) stick around under a better definition of content.
>
> I would welcome such cleanup, especially after we switch to a VCS that
> does file renaming.
>
> IMO, there needs to be one header file like squid.h that is guaranteed
> to be the first one included by all other source files in src/. That
> file should only contain things needed by 99.9% of the code base. This
> is usually limited to hacks that change some global system or compiler
> effects. The rest should have their own purpose-specific header files.

I was thinking that squid.h is the good choice for that. Just with much
less tangled dependancy than it currently has. With some that is currently
in defines.h.

FWIW: I have a test run going over typedefs and managed to kill a few
dozen lines of code there without side-effects on linux. I'll have it in
cleanup branch soon for testing on other OS and compilers.

>
> If the source code needs something used by others, it needs to include
> something.h.
>
> There is also a question of whether some lib/ stuff needs to be moved to
> src/, but that is a separate debate and we need a better VCS for that as
> well.

Some does, ie IPAddress I think should go back. My initial reason for
placing it there is no longer valid. IMO Mem* and Debug shouls not be
there either, but in wherever the core goes.

Amos
Received on Mon Feb 11 2008 - 14:44:49 MST

This archive was generated by hypermail pre-2.1.9 : Sat Mar 01 2008 - 12:00:09 MST