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 8475909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:01:34+00:00 2026-06-10T18:01:34+00:00

First… I have the following code in a file named core_ns.h /* * the

  • 0

First… I have the following code in a file named core_ns.h

/*
 * the prototype for the function that will be called when a connection
 * is made to a listen connection.  
 * Arguments:
 *    Server_Connection - ID of the listen connection that received the request
 *    New_Connection    - ID of the data connection that was created.
 */
typedef void (* CORE_NS_Connect_Callback)
                (CORE_NS_Connection_Type  Server_Connection,
                 CORE_NS_Connection_Type  New_Connection);

I then have the following in a file named ParameterServerCSC.h

class ParameterServer{
public:
    //-------------------------------------------------------------------------------
    //FUNCTION: sendCallback
    //
    //PURPOSE: This method will be performed upon a connection with the client. The 
    //Display Parameter Server will be sent following a connection.
    //-------------------------------------------------------------------------------
    void sendCallback (CORE_NS_Connection_Type serverConnection, CORE_NS_Connection_Type newConnection);
}; // end class ParameterServer

Finally… I have the following usage in a file named ParameterServer.cpp

       //-------------------------------------------------------------------------------
      //FUNCTION: setup 
      //
      //PURPOSE: This method will perform any initialization that needs to be performed
      //at startup, such as initialization and registration of the server. 
      //-------------------------------------------------------------------------------
      void ParameterServer::setup(bool isCopilotMfd){

            CORE_NS_Connect_Callback newConnCallback; 
            newConnCallback = &ParameterServer::sendCallback;//point to local function to handle established connection.
      }

I’m getting the following warning:

warning: converting from void (ParameterServer::*)(CORE_NS_Connection_Type, CORE_NS_Connection_Type)' tovoid (*)(CORE_NS_Connection_Type, CORE_NS_Connection_Type)’
MY_PROJECT/DisplayParameterServer
ParameterServerCSC.cpp

Im using LynxOS178-2.2.2/GCC C++ compilier. My solution builds with this warning. I am trying to understand the meaning of the warnings. Any insight to this is appreciated.

  • 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-10T18:01:36+00:00Added an answer on June 10, 2026 at 6:01 pm

    ParameterServer::sendCallback is a member function or method (its type is void (ParameterServer::*)(CORE_NS_Connection_Type, CORE_NS_Connection_Type)) so it cannot be used as a function (type void (*)(CORE_NS_Connection_Type, CORE_NS_Connection_Type)).

    You need to make it a static member function:

    static void sendCallback (CORE_NS_Connection_Type serverConnection, CORE_NS_Connection_Type newConnection);
    

    Otherwise (depending on calling convention) when the API calls sendCallback the parameters will be set up incorrectly and will appear incorrect; at the very least the hidden this parameter will be garbage.

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

Sidebar

Related Questions

First, I have a list of QWidget s that I won't know the length
First off I have an app that provides the user information about the amount
First, a little background (greatly simplified): I have two classes, one called Entity and
First Im a noob in LINQ ! Then, the thing is that I have
First of all I have seen that there are many questions about unrecognized selector
First I will show you example tables that my issue pertains to, then I
first take a look on this picture from localScope app : i have 2
First i selected images from photo library to ALAsset Library and after that i
First you should know I have looked into many questions and none of them
First I want to thank you guys here, because your posts have gotten me

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.