www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Wiedmann <...@ispsoft.de>
Subject mod_perl/5318: Variable names in prototypes causing problems
Date Mon, 15 Nov 1999 18:39:40 GMT

>Number:         5318
>Category:       mod_perl
>Synopsis:       Variable names in prototypes causing problems
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Mon Nov 15 10:40:00 PST 1999
>Last-Modified:
>Originator:     joe@ispsoft.de
>Organization:
apache
>Release:        1.3.9
>Environment:
Windows NT 4.0, Visual C++ 5.0, ActivePerl build 521
>Description:
The Apache headers use to have prototypes like

  API_EXPORT(void) ap_add_loaded_module(module* mod);

In other words, the argument declaration includes variable names like
"mod". Unfortunately these variable names are quite generic, for
example "mod" for module. This is causing problems if the same
symbol is already defined by the C preprocessor.

This is the case in particular when compiling mod_perl with ActivePerl:
The symbols "mod" and "instr" must not be used as variable names. The
concerned files are httpd.h and http_config.h. I beg to remove these
variable names (which are meaningless anyways) or rename the variables
to be less generic.

>How-To-Repeat:

>Fix:
A patch follows. AFAIK the patch has no functional difference to the
current version and can be applied without any problems.

*** http_config.h.jworig	Thu May 06 20:16:10 1999
--- http_config.h	Mon Nov 15 18:33:20 1999
***************
*** 325,332 ****
  
  API_EXPORT(void) ap_add_module(module *m);
  API_EXPORT(void) ap_remove_module(module *m);
! API_EXPORT(void) ap_add_loaded_module(module *mod);
! API_EXPORT(void) ap_remove_loaded_module(module *mod);
  API_EXPORT(int) ap_add_named_module(const char *name);
  API_EXPORT(void) ap_clear_module_list(void);
  API_EXPORT(const char *) ap_find_module_name(module *m);
--- 325,332 ----
  
  API_EXPORT(void) ap_add_module(module *m);
  API_EXPORT(void) ap_remove_module(module *m);
! API_EXPORT(void) ap_add_loaded_module(module *);
! API_EXPORT(void) ap_remove_loaded_module(module *);
  API_EXPORT(int) ap_add_named_module(const char *name);
  API_EXPORT(void) ap_clear_module_list(void);
  API_EXPORT(const char *) ap_find_module_name(module *m);
***************
*** 361,367 ****
  
  void *ap_create_request_config(pool *p);
  CORE_EXPORT(void *) ap_create_per_dir_config(pool *p);
! void *ap_merge_per_dir_configs(pool *p, void *base, void *new);
  
  /* For http_core.c... (<Directory> command and virtual hosts) */
  
--- 361,367 ----
  
  void *ap_create_request_config(pool *p);
  CORE_EXPORT(void *) ap_create_per_dir_config(pool *p);
! void *ap_merge_per_dir_configs(pool *, void *, void *);
  
  /* For http_core.c... (<Directory> command and virtual hosts) */
  
***************
*** 401,408 ****
  /* for mod_perl */
  
  CORE_EXPORT(const command_rec *) ap_find_command(const char *name, const command_rec *cmds);
! CORE_EXPORT(const command_rec *) ap_find_command_in_modules(const char *cmd_name, module
**mod);
! CORE_EXPORT(void *) ap_set_config_vectors(cmd_parms *parms, void *config, module *mod);
  CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, const char *l);
  
  #endif
--- 401,408 ----
  /* for mod_perl */
  
  CORE_EXPORT(const command_rec *) ap_find_command(const char *name, const command_rec *cmds);
! CORE_EXPORT(const command_rec *) ap_find_command_in_modules(const char *, module **);
! CORE_EXPORT(void *) ap_set_config_vectors(cmd_parms *parms, void *, module *);
  CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, const char *l);
  
  #endif
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <apbugs@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]




Mime
View raw message