I am not able to find warn-codes that should be used in
#pragma warn -<code>
directive!
Could anybody advise where I can see a list of warnings with codes that (as I understand) should be 3-letters code?
I have a pro-C program that produces some warnings.
(Do not advise, please, correct - it is not an option! I will show why later.)
I have found the cc compiler option to disable those warning from a command line and that works, but it is not suitable in my case.
(The compilation in this system performed by build-up make 'system' with out-reached option files, that provides rules and option for processing different building steps; even to change a macro would required to change a *.mak file, that is preferred not to do!)
Therefore I am looking for a '#pragma warn -..' solution
I have found the command line option (for cc) to suppress warnings (I have two of them:
..., line ...: warning: no explicit type given (E_NO_EXPLICIT_TYPE_GIVEN)
..., line ...: warning: implicit function declaration: ...(E_NO_IMPLICIT_DECL_ALLOWED)
That is printed with 'tags' (in parentheses,) by using the cc option '-errtags'
);
- so, by
> cc ... ... -erroff=E_NO_EXPLICIT_TYPE_GIVEN -erroff=E_NO_IMPLICIT_DECL_ALLOWED
those warnings were suppressed.
But I need to do it from code!
As I understand warnings could be controlled by the
#pragma warn [+,-,.]<code>
I have found some related in:
C - Define #pragma statements
and
#pragma warn directive in c
but, not clear to what compiler that is applied and could not find anything related to Sun Solaris 'cc' compiler.
(On 'man cc' page the option -erroff is mentioned, but nothing about possible warnings and about #pragma ! )
Why I can't just correct the warning-risers:
- first one '..no explicit type given' produced by the 'proc' precompiler generated function without the return type defined - kind of K&R style.
I was not able to change any option successfully for 'proc' (it seems the code=ANSI_C should resolve that, but by that bunch of Oracle function becomes compiler errors! )
- second one ' .. implicit function declaration' produced by some library function (added on linkage faze) that have no headers in the system.
Our system is pretty stricted and just create a header is not an option - long bureaucratic process that would follow only an obvious needs (try to prove to user that needs!) and with unacceptable amount of system testings for all program where those libraries are used!)
Thus, correct and 'simple' way is impossible here.
So, I am looking for a way to suppress those warning from the program code; so, by '#pragma ...'
and could not find information on the Sun cc #pragmas and the 'warn' codes!
Will appreciate your help!