#pragma warn codes on Sun Solaris to disable some warns?


 
Thread Tools Search this Thread
Top Forums Programming #pragma warn codes on Sun Solaris to disable some warns?
# 1  
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!
# 2  
Old 05-12-2011
Sun studio (what version) or are you using gcc?
OS version?
#pragma [stuff here] is totally compiler dependent.
# 3  
Old 05-12-2011
Quote:
Originally Posted by jim mcnamara
Sun studio (what version) or are you using gcc?.
OS version?
- nothing with Sun Studio:
Code:
MACHTYPE=sparc-sun-solaris2.10
OSTYPE=solaris2.10

Quote:
Originally Posted by jim mcnamara
#pragma [stuff here] is totally compiler dependent.
- agree, that why I am asking where I can found the pragma information for 'cc' compiler on Sun Solaris.

Quote:
Originally Posted by fpmurphy
Which specific version of the compiler are you using?
- how I can know that?
I did try to find it, but couldn't.
# 4  
Old 05-13-2011
It is difficult to advise/help you if you do not know what compiler you are using.

What happens if you enter:
Code:
gcc -v
cc -v

What output do you get?
# 5  
Old 05-16-2011
Quote:
Originally Posted by fpmurphy
It is difficult to advise/help you if you do not know what compiler you are using.

What happens if you enter:
Code:
gcc -v
cc -v

What output do you get?
Code:
> cc -v
usage: cc [ options] files.  Use 'cc -flags' for details
>
> gcc -v
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.6
> alias cc
-bash: alias: cc: not found

I know, that our make-files are using the 'cc' which is:
Code:
> which cc
/usr/bin/cc
>

Agah!!
I have the results on 'what':

The Version: RELEASE VERSION Sun C 5.10 SunOS_sparc 2009/06/03

Here is all 'where' result:
Code:
> what /usr/bin/cc
/usr/bin/cc:
        SunOS 5.10 Generic January 2005
        stdio.h 1.84    04/09/28 SMI
        feature_tests.h 1.25    07/02/02 SMI
        ccompile.h      1.2     04/11/08 SMI
        isa_defs.h      1.29    08/06/06 SMI
        stdio_iso.h     1.8     05/08/16 SMI
        va_list.h       1.15    04/11/19 SMI
        stdio_tag.h     1.4     04/09/28 SMI
        stdio_impl.h    1.15    07/03/05 SMI
        stdio_c99.h     1.2     04/03/29 SMI
        stdarg.h        1.47    04/09/28 SMI
        stdarg_iso.h    1.4     04/11/19 SMI
        va_impl.h       1.1     04/11/19 SMI
        stdarg_c99.h    1.2     04/09/28 SMI
        nl_types.h      1.14    00/09/16 SMI
        string.h        1.27    07/01/14 SMI
        string_iso.h    1.5     04/06/18 SMI
        assert.h        1.10    04/05/18 SMI
        limits.h        1.59    04/08/24 SMI
        limits_iso.h    1.2     03/12/04 SMI
        int_limits.h    1.9     04/09/28 SMI
        stdlib.h        1.51    04/06/30 SMI
        stdlib_iso.h    1.9     04/09/28 SMI
        stdlib_c99.h    1.2     04/03/29 SMI
        stdbool.h       1.1     03/12/04 SMI
        values.h        1.16    04/03/29 SMI
        signal.h        1.43    04/09/28 SMI
        types.h 1.86    07/09/20 SMI
        machtypes.h     1.13    99/05/04 SMI
        int_types.h     1.10    04/09/28 SMI
        select.h        1.19    04/01/28 SMI
        time_impl.h     1.11    05/05/19 SMI
        time.h  2.76    05/06/14 SMI
        time.h  1.45    08/01/09 SMI
        time_iso.h      1.4     04/09/07 SMI
        signal_iso.h    1.1     99/08/09 SMI
        signal_iso.h    1.6     03/05/02 SMI
        unistd.h        1.43    06/03/10 SMI
        signal.h        1.66    04/09/28 SMI
        siginfo.h       1.59    04/07/15 SMI
        machsig.h       1.15    99/08/15 SMI
        procset.h       1.25    04/07/16 SMI
        stat.h  1.11    04/09/28 SMI
        stat_impl.h     1.4     03/12/04 SMI
        unistd.h        1.76    06/03/10 SMI
        wait.h  1.23    04/06/03 SMI
        resource.h      1.37    07/02/07 SMI
        errno.h 1.17    03/01/03 SMI
        errno.h 1.20    00/01/12 SMI
        fcntl.h 1.17    06/03/10 SMI
        fcntl.h 1.52    07/03/05 SMI
        dlfcn.h 1.45    05/08/08 SMI
        auxv.h  1.37    07/08/15 SMI
        auxv_SPARC.h    1.5     07/10/22 SMI
        locale.h        1.20    03/12/04 SMI
        locale_iso.h    1.3     03/12/04 SMI
        libintl.h       1.16    04/09/28 SMI
        times.h 1.10    97/08/12 SMI
        utsname.h       1.30    04/09/28 SMI
        ctype.h 1.35    04/09/28 SMI
        ctype_iso.h     1.3     04/09/28 SMI
        ctype_c99.h     1.2     04/09/28 SMI
        regex.h 1.25    04/09/28 SMI
        err_driver.c 1.24 05/05/04
        param.h 1.82    06/01/30 SMI
        err_print.c 1.28 99/12/23
        i18n.c 1.20 99/03/30
        stddef.h        1.18    04/09/28 SMI
        stddef_iso.h    1.2     03/03/06 SMI
        systeminfo.h    1.19    04/07/16 SMI
        picl.h  1.5     04/01/30 SMI
        ucontext.h      1.22    04/09/28 SMI
        ucontext.h      1.31    03/12/18 SMI
        regset.h        1.29    07/09/06 SMI
        privregs.h      1.8     03/05/22 SMI
        psr.h   1.4     03/04/21 SMI
        fsr.h   1.3     97/02/11 SMI
        mUT.h 1.1 04/05/27
        libAU.h 1.2 05/09/12
        RELEASE VERSION Sun C 5.10 SunOS_sparc 2009/06/03
        RELEASE VERSION Sun __version_update_notification_toks SunOS_sparc __version_update_notification_patch_sparc 2009/06/03
        mUT.c 1.3 04/05/30
>

Is that make any possibility to find the #pragmas' list?
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

8. 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
Login or Register to Ask a Question