I am working on a legacy project that uses yacc - 1.9 20130304. The generated .c files contain the sccsid string (from the skeleton.c):
#ifndef lint
static const char <file_name>sccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
#endif
When compiling with gcc -Wall I get the expected warning:
warning: '<file_name>sccsid' defined but not used [-Wunused-const-variable=]
One way that I can remove the warning is to somehow add __attribute__((unused))
in the generated file but that would be very tedious since the project is huge and contains a lot of parser-generators with a complicated makefile structure.
Therefore I am wondering if there is a simpler way. Can I tell yacc to not generate the sccs id? Or can I instruct gcc to not warn on #ifdef lint? Or maybe some other solution?
Edit: I cannot upgrade to a newer version of byacc (that doesn't insert the sccsid) or modify skeleton.c and recompile yacc because we must ship the software with a specific version of linux and libraries due to software assurance guarantees.
Any suggestions/hints are appreciated!