How can I hide "defined but not used" warnings in GCC?

how to hide
how to hide apps
how to hide in public
how to hide games
how to hide apps on samsung
how to hide apps in vivo
how to hide apps from home screen
app to hide apps android

I have a bunch of compile time asserts, such as:

CASSERT(isTrue) or CASSERT2(isTrue, prefix_)

When compiling with GCC I get many warnings like 'prefix_LineNumber' defined but not used. Is there a way I can hide warnings for compile time asserts? I had no luck searching the GCC documentation. I thought I might have the var automatically used globally inside the same macro but I couldn't think of any way to do it.

Does anyone know of a way to hide that warning in GCC?

Just saw this thread while searching for solutions to this problem. I post here for completeness the solution I found...

The GCC compiler flags that control unused warnings include:

-Wunused-function
-Wunused-label
-Wunused-parameter
-Wunused-value
-Wunused-variable
-Wunused (=all of the above)

Each of these has a corresponding negative form with "no-" inserted after the W which turns off the warning (in case it was turned on by -Wall, for example). Thus, in your case you should use

-Wno-unused-function

Of course this works for the whole code, not just compile-time asserts. For function-specific behaviour, have a look at Function attributes.

How to Hide Apps on Android (No Root), If you are looking to hide private apps (like Tinder etc.) on an Android smartphone, there is a way Duration: 2:06 Posted: Aug 22, 2016 To hide one, swipe left on it and tap “Hide” to make it disappear. You can also search for any specific apps you want to hide using the field at the top of the screen. Once you hide it, the app disappears.

Solution for GCC not causing conflicts with other compilers

#ifdef __GNUC__
#define VARIABLE_IS_NOT_USED __attribute__ ((unused))
#else
#define VARIABLE_IS_NOT_USED
#endif

int VARIABLE_IS_NOT_USED your_variable;

How to Hide Apps on Android, Learn 4 different ways to hide apps on your Android device with our video tutorial​. We'll walk Duration: 4:35 Posted: Nov 25, 2017 Yes, you can have your precious TV and a chic mantel, too. Lia Griffith painted a canvas in soft twilight hues to hide her ugly black box when it's off. Get the tutorial here »

This is one of the most anoying warnings, although I undestand that it may useful (sometimes) to check dead code. But I usually have static functions for debugging, or functions that maybe useful sometime in the future, or that are only used temporaly, and I want to keep them in the code.

Fortunately this warning does not care about inline functions.

inline static foo()
{
}

Secret Hiding Places You've Never Thought Of, Got some cash or valuables to hide? Try one of these clever, simple ways to hide those items from all but the smartest thieves. Select "File" and "Open" from the program's navigation bar. Choose the file that you wish to hide the text. 2. Locate the text within the HTML document you want to hide.

You can create a null statement and cast the result to void. This is portable across compilers, and gcc will not give you any warnings, even with -Wall and -Wextra enabled. For example:

int var;    // var is not used
(void)var;  // null statement, cast to void -- suppresses warning

A common technique is to create a macro for this:

#define UNUSED(x) ((void)(x))

int var;
UNUSED(var);

How can I hide/unhide my conversations? – TextMe Apps Help Center, Then tap on Hide. TM-iOS-Settings-Hide-Unhide1.png. This turns on the hidden mode on the conversation. It will not be displayed  Hiding money legally is easy and useful in this day's economy. There are no secrets in how to hide money legally. There's the old-fashioned under-the-mattress "safe," but that really isn't that safe. There are much safer ways these days. You can start by obtaining a safety deposit box.

#define UNUSED_VAR     __attribute__ ((unused))

for any variable just use the above macro before its type for example:

UNUSED_VAR int a = 2;

How to hide apps on your iPhone's home screen and search , A determined detective will be able to find "hidden" apps if they know what to look for. All that said, here are some strategies for hiding apps from  I can see that this question has been asked before. Why hasn't FB taken the steps to assure that folks are able to hide their online status. I know there used to be a way.

How do I hide a photo or video I've been tagged in from my Instagram, To hide a photo or video you're tagged in from your Instagram profile, first tap the photo.

Hiding and unhiding accounts - Google Ads Help, Hiding and unhiding accounts. If your dashboard is cluttered with accounts that you're no longer using, you can hide them so that your manager account pages 

Hide App Store purchases, Hide apps on your iPhone, iPad, or iPod touch. Open the App Store app, then tap Today at the bottom of the screen. Tap the account button or 

Comments
  • Can this be set per file?
  • The problem with such a flag is that it going to hide other variables which may indeed be unused and should be removed from your software. So it's not a good solution. However, marking one specific variable as willingly unused is much better (i.e. a variable used to run some code when your library is loaded, which is a neat C++ feature.)
  • that's exactly how it's also done in gcc source for unused function arguments. +1 :)
  • I found that using ____attribute____ ((____unused____)) works for GCC 4.x.x
  • Work like a charming thing...UPVOTED
  • Then why don't you wrap such functions in preprocessor directives. E.g. #ifdef UNIT_TEST static foo() ?
  • Oddly, I still get warnings. For example, when I call system() and don't care about the return: (void)system(cmd.c_str()); I don't understand why this should generate a warning.
  • @BobDoolittle: Huh, that's interesting, I haven't seen that behavior before. What compiler and what version of that compiler are you using?
  • gcc 4.8.2 on Ubuntu 14.04. I am compiling all my source with -Wunused-result, and looking for a way to explicitly suppress the warning for those places where it's verified that the behavior is correct. I've always used a cast to (void) for that in the past, but not working here.
  • @BobDoolittle: I'm unable to reproduce that behavior using the same gcc 4.8.2 on Ubuntu 14.04. Can you post/link an SSCCE along with the exact command line arguments you're passing to the compiler?
  • We have adopted this for out project. BUT, only for cases where the compiler is mistaken in its warnings. For instance, we have some variables which are only ever accessed by pointer, so the compiler believes them to be unused. It is acceptable to supress warnings for such, but truly unused variables must be removed from our code.
  • Vote. Works for me.
  • Worked like a charm.