Sponsored Content
Top Forums Programming #pragma warn codes on Sun Solaris to disable some warns? Post 302521565 by alex_5161 on Wednesday 11th of May 2011 04:16:20 PM
Old 05-11-2011
#pragma warn codes on Sun Solaris to disable some warns?

I am not able to find warn-codes that should be used in
#pragma warn -<code>
directive!Smilie

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.SmilieSmilie

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!
 

8 More Discussions You Might Find Interesting

1. Tips and Tutorials

Solaris Patch exit codes

The most common Solaris exit codes you will see is 2 or 8, but have you ever had a different exit code and wondered what it means ? Well you need not wonder no more... Patch Exit Codes ---------------- 0 No error 1 Usage error 2 Attempt to apply a patch that's already... (1 Reply)
Discussion started by: Tornado
1 Replies

2. Solaris

Problem in generating codes in solaris server!!

I have a solaris server having oracle and oracle apps running ! When some one attempts to generate a code, they click a link on the web interface which runs an rsh script from a computer called Helpdesk onto my solaris server and what happens is the web interface show an error message saying... (4 Replies)
Discussion started by: SmartestVEGA
4 Replies

3. Solaris

Sun Fire 280R Sun Solaris CRT/Monitor requirements

I am new to Sun. I brought Sun Fire 280R to practice UNIX. What are the requirements for the monitor/CRT? Will it burn out old non-Sun CRTs? Does it need LCD monitor? Thanks. (3 Replies)
Discussion started by: bramptonmt
3 Replies

4. Programming

print C codes from Solaris 10, x86 to cygwin on Windows?

Sorry, I meant to type "porting C codes from Solaris 10, x86 to cygwin in Windows" I just installed cygwin 1.7 to my Windows PC. I have a C program that compiles fine using gcc on Solaris 10, x86. This C program contains system calls like: system ("ls -l > file.txt"); and system... (3 Replies)
Discussion started by: serendipity1276
3 Replies

5. UNIX for Dummies Questions & Answers

Disable Serials ports in Sun Fire v490

Hello people from Argentina i said you Hello. I am doing some works from an auditory. They want to disable login prompts on serial ports. Somebody knows how to do that? Thank your time. (1 Reply)
Discussion started by: enkei17
1 Replies

6. Solaris

Sun T2000 error codes

I got a Power supply failure. I replaced the power supply and still got the error. Any ideas on what I should try next? (1 Reply)
Discussion started by: 642fiddi
1 Replies

7. Solaris

pramga warn codes: where I can see all possible?

(I will not duplicate my post that I create in 'Programming' ( My post ), but the issue also (after C ) is related to Sun Solaris.) I need to find the warning-codes to be used in the #pragma warn.. C-code directives to suppress some compilation warnings. More desciptive explanation you... (2 Replies)
Discussion started by: alex_5161
2 Replies

8. Solaris

Sun Cluster query for enable/disable

Hi, I perform clrs enable/disable resource-group to start/shutown sybase db. If I do it through through scsetup , it asks for Do you require to change the state of resource "sybaseapp-rs" on individual nodes or zones that can master the resource (yes/no) ?. I am bit confused of above... (1 Reply)
Discussion started by: tuxian
1 Replies
warnings(3pm)						 Perl Programmers Reference Guide					     warnings(3pm)

NAME
warnings - Perl pragma to control optional warnings SYNOPSIS
use warnings; no warnings; use warnings "all"; no warnings "all"; use warnings::register; if (warnings::enabled()) { warnings::warn("some warning"); } if (warnings::enabled("void")) { warnings::warn("void", "some warning"); } if (warnings::enabled($object)) { warnings::warn($object, "some warning"); } warnings::warnif("some warning"); warnings::warnif("void", "some warning"); warnings::warnif($object, "some warning"); DESCRIPTION
The "warnings" pragma is a replacement for the command line flag "-w", but the pragma is limited to the enclosing block, while the flag is global. See perllexwarn for more information. If no import list is supplied, all possible warnings are either enabled or disabled. A number of functions are provided to assist module authors. use warnings::register Creates a new warnings category with the same name as the package where the call to the pragma is used. warnings::enabled() Use the warnings category with the same name as the current package. Return TRUE if that warnings category is enabled in the calling module. Otherwise returns FALSE. warnings::enabled($category) Return TRUE if the warnings category, $category, is enabled in the calling module. Otherwise returns FALSE. warnings::enabled($object) Use the name of the class for the object reference, $object, as the warnings category. Return TRUE if that warnings category is enabled in the first scope where the object is used. Otherwise returns FALSE. warnings::fatal_enabled() Return TRUE if the warnings category with the same name as the current package has been set to FATAL in the calling module. Otherwise returns FALSE. warnings::fatal_enabled($category) Return TRUE if the warnings category $category has been set to FATAL in the calling module. Otherwise returns FALSE. warnings::fatal_enabled($object) Use the name of the class for the object reference, $object, as the warnings category. Return TRUE if that warnings category has been set to FATAL in the first scope where the object is used. Otherwise returns FALSE. warnings::warn($message) Print $message to STDERR. Use the warnings category with the same name as the current package. If that warnings category has been set to "FATAL" in the calling module then die. Otherwise return. warnings::warn($category, $message) Print $message to STDERR. If the warnings category, $category, has been set to "FATAL" in the calling module then die. Otherwise return. warnings::warn($object, $message) Print $message to STDERR. Use the name of the class for the object reference, $object, as the warnings category. If that warnings category has been set to "FATAL" in the scope where $object is first used then die. Otherwise return. warnings::warnif($message) Equivalent to: if (warnings::enabled()) { warnings::warn($message) } warnings::warnif($category, $message) Equivalent to: if (warnings::enabled($category)) { warnings::warn($category, $message) } warnings::warnif($object, $message) Equivalent to: if (warnings::enabled($object)) { warnings::warn($object, $message) } See "Pragmatic Modules" in perlmodlib and perllexwarn. perl v5.12.1 2010-04-26 warnings(3pm)
All times are GMT -4. The time now is 01:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy