I\'m getting this warning on a stack variable:
warning: object.member may be used uninitialized in this function
In this case I do not wish to
The accepted answer has two big problems that requires more than a comment. First, it deactivates the warning for the whole file. If that pragma resides in a header, probably for more. Warnings are useful and if it is indeed a false positive, one should disable the warning for a bunch of code as small as possible.
Then the warning in the OP is "maybe uninitialized" which is deactivated by -Wmaybe-uninitialized, as opposed to -Wuninitialized.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
function() or int variable;
#pragma GCC diagnostic pop