how to enable c compiler warning

hi, all. i am new to solaris c compiler. in gnu c compiler, i use"gcc -Wall -ansi -o aa aa.c"what's the equivelent in solaris c compiler?thanks
[172 byte] By [alvinhonga] at [2007-11-27 3:56:04]
# 1
HiI don't think that there is an option to show 'extra' warnings. -w disables warnings. -xc99 controls whether C89 or C99 is used (or part of C99). -X[c|a|t|s] controls the degree of conformance (from strictly conformant to K&R).Paul
Paul_Floyda at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

There *IS* an option to show extra warnings.

You can use -v to enable additional checks for questionable/non-portable constructs.

If you want to verify that your program is fully conformant to the standard (C99/C89) then you should use -Xc for strict conformance checking.

If you want extensive checking of your program you can use a separate "lint" utility.

regards,

__Fedor.

SFVa at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
thanks all.hi, is lint already included in solaris, or do i need to download one
alvinhonga at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4
lint is part of Sun Studio, it should be in the same directory as, for example, C compiler, cc.
MaximKartasheva at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5
Both lint and C compiler are included into Sun Studio product, which you can download for free.Whether it is included in your system depends on what Solaris do you have.Btw, its not only for Solaris but for Linux as well :)regards,__Fedor.
SFVa at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6
i used studio's "simple makefile" template, and as i can see in the makefile, it already used -Xcc, but when i compile it, it passes without giving any warning, even if i have a lot of un-used variable.and how do i use lint in studio, or in a terminal?thanks
alvinhonga at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 7

Are you referring to the option -Xcc? If so, Fedor above mentioned the flag -Xc (strict conformance check).

To run lint from a terminal window, simply refer to the same location where the cc is installed but type lint instead. Should work for you, and will likely give you the warnings you are wondering about.

ddpa at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 8
> There *IS* an option to show extra warnings.> > You can use -v to enable additional checks for> questionable/non-portable constructs.Interesting! I'd always looked for a +w/+w2 option in the man page (like for CC).Paul
Paul_Floyda at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 9
You know, C compiler was there longer than C++ one :)
SFVa at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 10
> You know, C compiler was there longer than C++ one :)Whichever came first, it would be nice to try homogeneizing the options between these compilers.
Marc_Glissea at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 11

> it would be nice to try homogeneizing the options between these compilers.

We have this goal as one of our targets, and are moving towards it.

Yet doing incompatible changes is not what we easily commit to.

Say, we cant do it in update.

This particular issue is not the most striking incompatibility in options between our 3 compilers (C/C++/Fortran).

regards,

__Fedor.

SFVa at 2007-7-12 9:00:14 > top of Java-index,Development Tools,Solaris and Linux Development Tools...