Re: cvs commit: squid/src url.c

2008-08-28 Thread Benno Rice


On 29/08/2008, at 5:09 AM, Henrik Nordstrom wrote:


On tis, 2008-08-26 at 19:34 -0600, Benno Rice wrote:

benno   2008/08/26 19:34:42 MDT

 Modified files:
   src  url.c
 Log:
 Fix breakage caused by recent GCC fixes.

 The fixes in question prevented the returning of pre-defined  
method_t
 structures as well as any attempts at error reporting (and  
avoiding SEGVs) by
 removing all checks against NULL.  If these checks are causing  
problems, please
 consult with me about the best way to avoid them without messing  
up the actual

 logic.


Sorry about the predefined method messup.


No worries.

But the NULL checks after allocation is junk. The Squid xmalloc/ 
xstrdup

functions can not return NULL (Squid aborts in such case, before
returning).


Yeah, Adrian explained that to me.  I was just following my ingrained  
practice of always checking what malloc gives me and didn't realise  
that xmalloc had different behaviour.  I'll get rid of those checks  
shortly.


--
Benno Rice
[EMAIL PROTECTED]





Re: cvs commit: squid/src url.c

2008-08-28 Thread Henrik Nordstrom
On tis, 2008-08-26 at 19:34 -0600, Benno Rice wrote:
> benno   2008/08/26 19:34:42 MDT
> 
>   Modified files:
> src  url.c 
>   Log:
>   Fix breakage caused by recent GCC fixes.
>   
>   The fixes in question prevented the returning of pre-defined method_t
>   structures as well as any attempts at error reporting (and avoiding SEGVs) 
> by
>   removing all checks against NULL.  If these checks are causing problems, 
> please
>   consult with me about the best way to avoid them without messing up the 
> actual
>   logic.

Sorry about the predefined method messup.

But the NULL checks after allocation is junk. The Squid xmalloc/xstrdup
functions can not return NULL (Squid aborts in such case, before
returning).

It can be discussed if this is good or bad, but it's the Squid-2 coding
standard, and adding checks here only adds overhead that will never
trigger and isn't seen anywhere else in the code..

Regards
Henrik


signature.asc
Description: This is a digitally signed message part