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

  • Home
  • SEARCH
  • 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 9316249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:34:12+00:00 2026-06-19T02:34:12+00:00

Given the following declaration for a function used to update a node in a

  • 0

Given the following declaration for a function used to update a node in a doubly linked list:

uint8 dl_update(DL_LIST **node, uint16 new_tag, void *new_object,
    uint32 new_size, void (*destructor)(void*))

And the following call to that function:

dl_update(&dlt_list, _TAG, zulu, sizeof(*zulu),
    (void(*)(void*)) &_free_dlt_object(delta));

What about the last argument would cause the compiler to emit the error message “lvalue required as unary ‘&’ operator”? The destructor function I am passing (and the structure it operates on) are defined as follows:

typedef struct DLT_OBJECT {
    char *word;
    uint8 number;
} DLT_OBJECT;

void _free_dlt_object(DLT_OBJECT *object) {
    free(object->word);
    free(object);
}

The following question seems to imply that its okay to cast a function pointer, so I do not believe that my doing so is causing the problem, although given that my code is running on a bare metal embedded system (listed as a possible gotcha in the question) I am not sure.

Is this a case of a simple grammatical error, or is it more of a structural problem? I have been operating under the impression that declaring function pointers with void pointer arguments was a good way of passing generic function pointers around to other functions…

  • 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-19T02:34:13+00:00Added an answer on June 19, 2026 at 2:34 am

    when using a function pointer, you are just passing a function, so you make the call like so

    dl_update(&dlt_list, _TAG, zulu, sizeof(*zulu), _free_dlt_object);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following declaration: <Extension()> Public Function ToJSON(ByVal target As Object) As String Dim
Given the following Delphil DLL declaration function csd_HandleData(aBuf: PChar; aLen: integer): integer; stdcall; what
Given the following code: $(.force-selection).blur(function() { var value = $('matched-item').val(); //check if the input's
Given the following code: function Person(firstName, lastName) { this.FirstName = firstName; this.LastName = lastName;
Given the following code (it's a macro that generates code for a list data
Given the following C++ code which doesn't mention a calling convention in the function
I'm using Visual Studion 2010, and given the following example function obtained from WinGDI.h:
I needed a function to return a string. I used the following code to
Given a list, I'd like to divide it into clusters using a boundary function.
given the following template function : template <class T> void DoSomething(T &obj1, T &obj2)

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.