Mailing List Archive

Re: svn commit: r1326980 - /httpd/httpd/trunk/modules/loggers/mod_log_debug.c
Odd... there is no language assurance that these statics remain static
across module reloads. A static var != static fn.

On 4/17/2012 3:07 AM, jorton@apache.org wrote:
> Author: jorton
> Date: Tue Apr 17 08:07:11 2012
> New Revision: 1326980
>
> URL: http://svn.apache.org/viewvc?rev=1326980&view=rev
> Log:
> * modules/loggers/mod_log_debug.c: Mark private globals as static.
>
> Modified:
> httpd/httpd/trunk/modules/loggers/mod_log_debug.c
>
> Modified: httpd/httpd/trunk/modules/loggers/mod_log_debug.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/loggers/mod_log_debug.c?rev=1326980&r1=1326979&r2=1326980&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/loggers/mod_log_debug.c (original)
> +++ httpd/httpd/trunk/modules/loggers/mod_log_debug.c Tue Apr 17 08:07:11 2012
> @@ -35,8 +35,8 @@ typedef struct {
> apr_array_header_t *entries;
> } log_debug_dirconf;
>
> -const char *allhooks = "all";
> -const char * const hooks[] = {
> +static const char *allhooks = "all";
> +static const char * const hooks[] = {
> "log_transaction", /* 0 */
> "quick_handler", /* 1 */
> "handler", /* 2 */
>
>
>
Re: svn commit: r1326980 - /httpd/httpd/trunk/modules/loggers/mod_log_debug.c [ In reply to ]
On Tue, Apr 17, 2012 at 11:48:03PM -0500, William Rowe wrote:
> Odd... there is no language assurance that these statics remain static
> across module reloads. A static var != static fn.

I don't know what you mean here, sorry. static/extern for global
variables does have basically the same semantics as functions, it means
private/public to the compilation unit respectively. These variables
should not be public since they lack namespace-safety and are genuinely
private to the module. Am I missing something?

Regards, Joe