New webrev at:

  http://jurassic.us.oracle.com/~richb/6992087-v2/

On 11/29/11 08:32 AM, Danek Duvall wrote:
Rich Burridge wrote:

   http://jurassic.us.oracle.com/~richb/6992087-v1/

llib-lreadline:

   - line 29: if including stdio.h is necessary, then you should have a
     comment explaining why, because it shouldn't be necessary.  There are a
     bunch of lint library sources in the gate that don't get this quite
     right.

If I don't have the "#include <stdio.h>" in llib-lreadline. I get:

...
(cd /tank/ws/UL/6992087/components/readline/build/i86 ; /ws/onnv-tools/SUNWspro/sunstudio12.1/bin/lint -m32 -nsvx -I/tank/ws/UL/6992087/components/readline/build/i86 -I/tank/ws/UL/6992087/components/readline/readline-5.2/include -I/tank/ws/UL/6992087/components/readline/readline-5.2 -I/tank/ws/UL/6992087/components/readline/build/prototype/i386/usr/include -o readline ../../llib-lreadline) "/tank/ws/UL/6992087/components/readline/build/prototype/i386/usr/include/readline/rltypedefs.h", line 65: error: syntax error before or at: * "/tank/ws/UL/6992087/components/readline/build/prototype/i386/usr/include/readline/readline.h", line 416: error: syntax error before or at: * "/tank/ws/UL/6992087/components/readline/build/prototype/i386/usr/include/readline/readline.h", line 532: warning: no explicit type given "/tank/ws/UL/6992087/components/readline/build/prototype/i386/usr/include/readline/readline.h", line 532: error: syntax error before or at: * "/tank/ws/UL/6992087/components/readline/build/prototype/i386/usr/include/readline/readline.h", line 532: warning: old-style declaration or incorrect type for: rl_instream "/tank/ws/UL/6992087/components/readline/build/prototype/i386/usr/include/readline/readline.h", line 533: warning: no explicit type given "/tank/ws/UL/6992087/components/readline/build/prototype/i386/usr/include/readline/readline.h", line 533: error: syntax error before or at: * "/tank/ws/UL/6992087/components/readline/build/prototype/i386/usr/include/readline/readline.h", line 533: warning: old-style declaration or incorrect type for: rl_outstream "/tank/ws/UL/6992087/components/readline/build/prototype/i386/usr/include/readline/readline.h", line 827: error: syntax error before or at: FILE
lint: errors in llib-lreadline; no output created
lint: pass2 not run - errors in llib-lreadline
gmake: *** 
[/tank/ws/UL/6992087/components/readline/build/i86/llib-lreadline.ln] Error 3
...

I've added a comment to llib-lreadline to say that this is needed for the
FILE definition.


Also (from offline email discussions with you and Mike - thanks), I've added a
patch to adjust the #else definition of the rl_message() function prototype in
readline.h to include the function parameters, in a similar way to all the
other function declarations.

This means that a simple example such as:

$ cat test_readline.c

#include<stdio.h>
#include<readline/readline.h>

/*ARGSUSED*/
int
main(int argc, char **argv)
{
    char *line = readline("Enter a line: ");

    (void) printf("User supplied: `%s`\n", line);
}

now lints completely clean:

$ lint test_readline.c -lreadline -ltermcap
$





I assume you've tested the result against some program that uses readline?

There is a Comment in the Bugster CR related to testing.

Thanks.

_______________________________________________
userland-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/userland-discuss

Reply via email to