Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7918481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:31:33+00:00 2026-06-03T15:31:33+00:00

In building a module for Apache web server, I have encountered several instances where

  • 0

In building a module for Apache web server, I have encountered several instances where the declaration of a structure says that it only takes const char* members as in the declaration of apr_table_t and apr_array_header_t, but examples I am finding in various modules such as mod_security, and even the new ap_parse_form_data function indicate that a void * data type is being inserted into these structures.

My questions are how is this possible and why will my Visual Studio compiler complain if I attempt to use the same method?

A good example of this is mod_security with a create_request function that stores a void * in a request_rec note.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:31:35+00:00Added an answer on June 3, 2026 at 3:31 pm

    Pointers are convertible, and every object pointer type is convertible to void*, in the sense that storing any pointer in a void* doesn’t lose information. That is to say, the following is valid:

    struct Foo a;
    struct Foo * p = &a;   // p points to a
    
    void * q = p;          // OK, can store the value of p in q
    
    struct Foo * r = q;    // OK too - we can go back, and r points to a
    
    r->n = 1;
    

    Thus it is customary in C to pass around pointers as void*, knowing that those can always hold any other object pointer value, and only cast it back to the desired type when needed.

    One final word about char pointers in particular: Casting any object pointer to char* and actually dereferencing it as a pointer to an array of chars does not constitute type punning and is not a violation of the strict aliasing rule — this simply allows you to access the underlying binary representation of any object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At work we have several Solaris servers. Each server runs apache which we compiled
I'm building a module installer for my CMS and i have ran into a
I'm building a comment module for my web application. In the application I need
I have been building a module and making numerous changes without any problems until
I am building a custom ,module with a custom content type. I have defined
I have a project with multiple modules, including on that is responsible for building
I'm building a data seeder module that looks for all models using introspection and
I'm building web app that needs to communicate with another application using socket connections.
When building a multi-lingual website (with ASP.NET web forms), I'll use an HTTP module
I am currently building a little Apache-Mina Server app. I am using Maven to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.