Hi Charles,

On Thu, 29 Jan 2009 16:47:10 -0600
Charles Binford <Charles.Binford at Sun.COM> wrote:

> I'm working on the ADM project which will be delivered into ON in the
> future.  I'm trying to get my code "lint clean" but am having some
> troubles with a few constructs.  Is this page on lint directives
> valid for ON? http://docs.sun.com/app/docs/doc/819-5265/bjaih?a=view
> 
> I've been trying to fix the "constant in conditional" error.  Per the
> above web site the NOTE(CONSTCOND) syntax is the preferred syntax,
> and /* CONSTCOND */ is the old method.  I have a file where:
> 
>     NOTE(CONSTCOND) while (1) {
> 
> Gives and error, yet
> 
>     /* CONSTCOND */
>     while (1) {
> 
> works fine.
> 
> I have other code using marcos with the 'do {xxxx } while (0)' syntax
> and I can't get ANY form of the CONSTCOND to work. I'm even getting
> errors when I use the macros in /usr/include/sys/queue.h.

There's not much we can do about <sys/queue.h> unless you want to
fix upstream (in whichever *BSD we found it) and then sync up.
 
> I'm doing 'make lint' from my $SRC/cmd/hsm directory.  The Makefile
> there includes the top level Makefile.master, which has a bunch of
> lint flags defined.
>
> My lint version is:
> /ws/onnv-tools/SUNWspro/SS12/bin/lint -V
> lint: Sun C 5.9 SunOS_i386 Patch 124868-07 2008/10/07
> 
> Any suggestions are greatly appreciated.


What I ended up doing for fwflash was to add

-erroff=E_CONSTANT_CONDITION

to $SRC/cmd/fwflash/Makefile.com's LINTFLAGS definition.

It's ugly and annoying, but it works and was acceptable
to my RTI advocate :-) 


hth,
James C. McPherson
--
Senior Kernel Software Engineer, Solaris
Sun Microsystems
http://blogs.sun.com/jmcp       http://www.jmcp.homeunix.com/blog

Reply via email to