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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:05:56+00:00 2026-05-26T17:05:56+00:00

I want to do a function to get a pointer on a struct. I

  • 0

I want to do a function to get a pointer on a struct.
I done this :

void *getTokenList() {
    static t_token *list;

    return &list;
}

At compilation, I have this warning :
warning: variable ‘list’ set but not used [-Wunused-but-set-variable]

Is it possible to disable this warning for this function (only this one), or put an GCC attribute on this variable to hide this warning?

I had put #pragma GCC diagnostic ignored "-Wunused-but-set-variable" in top of my file but I want to hide this warning ONLY for this variable in this function.

Thanks,
Jean

  • 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-05-26T17:05:57+00:00Added an answer on May 26, 2026 at 5:05 pm

    You can use this to shut it off:

    (void)list;
    

    Alternatively and less portably you can use __attribute__((unused)).

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

Sidebar

Related Questions

Ideally I want a function something like the following (this example doesn't compile): void
In C++, it's possible to get a pointer to a (non-static) member function of
I want to consume a web service using jquery's get function. There is no
I want to get lambda function that will query for items which were submitted
i want to get the height property of a object: $('.selector img').each(function(index,e){ thisImage =
i want to create functions what get the folder size. I write small function:
I want a function/code which will return the value that the user submitted for
Okay i've seen this done somewhere before where you have a function that takes
I want to convert function object to function. I wrote this code, but it
I ran into a problem where I declared a function this way: struct my_struct

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.