Re: [PHP] sapi_add_header_ex() violating CODING_STANDARDS

2007-04-03 Thread js

Hi Jochem.

On 4/3/07, Jochem Maas <[EMAIL PROTECTED]> wrote:

from your explaination above one could infer that it was a transgression with
regard to CS. whether you could consider it a bug would depend on whether the 
code
in question actually caused problems or not ... the efree() at the point may 
have been
placed there conscientiously by someone who knew the CS rules and had good 
reason to
break them in this instance.

for a real answer I would recommend post a friendly question at 
internals@lists.php.net
(you might consider replacing the 'a bug' with something less inclined to 
illicit a
negative response, e.g. 'intentional'?)


agreed. 'a bug' is not a word for this kind of problem because I just
wanted to know,
as you said, whether this is intentional or not.

Thanks you for your useful advice.

Regards.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sapi_add_header_ex() violating CODING_STANDARDS

2007-04-03 Thread Jochem Maas
js wrote:
> Hi list.
> 
> I don't think this is the right place to talk about this,
> but writing PHP extensions I found that "sapi_add_header_ex()" in SAPI.c
> is violating a law of PHP CODING_STANDARDS, which says
> 
> "[1] Functions that are given pointers to resources should not free them
> *snip*
> Exceptions:
>  - The function's designated behavior is freeing that resource.  E.g.
> efree()
>  - The function is given a boolean argument, that controls whether or not
>the function may free its arguments (if true - the function must free
> its
>arguments, if false - it must not)
> *snip*
> "
> 
> Take a look at the source and you'll see the following code
> 
>if (!duplicate)
>efree(header_line);
> 
> not so intuitive.
> 
> Is this a bug?

from your explaination above one could infer that it was a transgression with
regard to CS. whether you could consider it a bug would depend on whether the 
code
in question actually caused problems or not ... the efree() at the point may 
have been
placed there conscientiously by someone who knew the CS rules and had good 
reason to
break them in this instance.

for a real answer I would recommend post a friendly question at 
internals@lists.php.net
(you might consider replacing the 'a bug' with something less inclined to 
illicit a
negative response, e.g. 'intentional'?)

> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] sapi_add_header_ex() violating CODING_STANDARDS

2007-04-03 Thread js

Hi list.

I don't think this is the right place to talk about this,
but writing PHP extensions I found that "sapi_add_header_ex()" in SAPI.c
is violating a law of PHP CODING_STANDARDS, which says

"[1] Functions that are given pointers to resources should not free them
*snip*
Exceptions:
 - The function's designated behavior is freeing that resource.  E.g. efree()
 - The function is given a boolean argument, that controls whether or not
   the function may free its arguments (if true - the function must free its
   arguments, if false - it must not)
*snip*
"

Take a look at the source and you'll see the following code

   if (!duplicate)
   efree(header_line);

not so intuitive.

Is this a bug?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php