Firebird's C preprocessor, gpre
, creates the following definition in the C code it generates from my .e source files:
static const ISC_STATUS *gds__null = 0; /* dummy status vector */
I'm not using this value anywhere in my code. Perhaps I should be, but I don't appear to have any need for it (any suggestions as to its appropriate usage are welcomed). In any case, as I'm not using the variable, I get the following compiler warning from gcc:
warning: 'gds__null' defined but not used
I'm wondering if there is some way to tell the compiler that I'm not going to be using the value of this variable, either in the code (keeping in mind that the definition is being inserted by the gpre
preprocessor; I have no way to change the definition) or via a command-line argument to the compiler. Or perhaps there is some way to instruct gpre not to inject this definition into the code if we're not using it. I'd like to preserve other unused variable warnings, so -Wno-unused
is not an option.
The solution here sort of works, as I can insert the following into an arbitrary function within my .e source file and it gets rid of the warning:
(void) gds__null;
However, it seems inelegant to place this line arbitrarily into a function where it's not serving any clear purpose just to get rid of the compiler warnings. I'm hopeful that there is a better solution. My last resort would be doing some sed
replacement on the generated C files post-gpre
/pre-gcc
, but I'm hoping it doesn't come to that.