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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:50:43+00:00 2026-05-14T01:50:43+00:00

I have a logger in a c++ application that uses defines as follows: #define

  • 0

I have a logger in a c++ application that uses defines as follows:

#define FINEST(...) Logger::Log(FINEST, _FILE, __LINE, __func, __VA_ARGS_)

However what I would like to do is to be able to switch off these logs since they have a serious performance impact on my system. And, it’s not sufficient to simply have my Logger not write to the system log. I really need to get rid of the code produced by the logs.

In order to do this, I changed the define to:

#define FINEST(...)

Which works, but this produces a whole bunch of warning in my code since variables are unused now. So what I would like to have is a sort of NULL FUNCTION that would not actually exist, but would not produce warnings for the unused variables.

So, said another way, I would like it to compile with no warnings (i.e. the compiler thinks that the variables are used for a function) but the function does not actually exist in the application (i.e. produces no performance hit).

Is this possible?

Thanks!

  • 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-14T01:50:43+00:00Added an answer on May 14, 2026 at 1:50 am

    You could define an empty function with unnamed parameters:

    void nullFunc(int, int, int, const char*, ...) {
    }
    

    Then redefine your macro to call this function:

    #define FINEST(...) nullFunc(FINEST, _FILE, __LINE, __func, __VA_ARGS_)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that uses call activity to call people. However, when the
I have an application that uses OAuth whose logic is something like this: If
I have an application that I'm writing that uses solely @properties. I have not
I have an application that is installed per-machine (since it uses a service). One
I have an ASP.NET MVC 3 (using Entity Framework 4.2) application that uses transactions
We have an application that uses NHibernate to connect to our database on SQL
I have a web application that uses Facebook Connect (built in Ruby on Rails
I have a web based application that uses userName and password for login. now
I already have an application that uses the SQLite database and a listadapter. I
I have an application I am developing that uses both jar libraries and native

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.