lint and CFLAGS


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting lint and CFLAGS
# 1  
Old 11-10-2008
lint and CFLAGS

I often find myself running lint in the following fashion:

lint -Idir-1 ... -Idir-n some-src.c

where a number of -Idirs should be coming from the make file.

Here is example:

Code:
 
$ cd dir1
$ grep ^CF makefile
CFLAGS = -g -I ../ver1/include
$ lint -I ../ver1/include sr1.c

then I go to another project

Code:
 
$ cd dir2
$ grep ^CF makefile
CFLAGS = -g -I /u/prod/ver1/include -I /u/prod/base1/include
$ lint -I /u/prod/ver1/include -I /u/prod/base1/include sr1.c

I am manualy cut/paste the -I parameters each time and I wander, is ther a way to automate it?

My working environment is ksh under Sys V type of Unix
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Programming

Problem with running lint

This is a strange problem that I can't figure out - I run lint on my C programs to weed out unused variables. The output can be quite large, so I use sed to cut out just unused variables section. The typical command looks like this: lint -I /usr/local/include -I./include -m hn.c As my... (3 Replies)
Discussion started by: migurus
3 Replies

2. Shell Programming and Scripting

Lint Command in unix

the thread is deleted (1 Reply)
Discussion started by: jhon1257
1 Replies

3. UNIX for Advanced & Expert Users

lint in unix

Hi All, Can any one help me in how to run "lint command " on .c files to list all functions with wrong return value in hp unix. Thanks in Advance. (1 Reply)
Discussion started by: jhon1257
1 Replies

4. AIX

[AIX] usages of lint for .cpp file?

Hi , I Want to apply AIX lint to my source code which all are *.cpp/*.h >lint test.cpp lint: 1286-332 File test.cpp must have a .c, .C or .ln extension. It is ignored. lint: 1286-334 There are no files to process. I am getting above error. -Ashok (3 Replies)
Discussion started by: ashokd001
3 Replies

5. Programming

lint comments

Hi can anyone help me regarding the meaning of the following lint messages. what is the use of having such lint comments in the c program. /*lint -esym(534,cputs,fgets,cprintf) */ /*lint -efile(766,pragmas.h) */ Thanks a lot in advance. (5 Replies)
Discussion started by: axes
5 Replies

6. UNIX for Dummies Questions & Answers

Purpose of lint in UNIX

Can Any One let me know abut the use on "lint" in UNIX...... (1 Reply)
Discussion started by: kumar_saurabh
1 Replies

7. Programming

Help from lint experts needed

how can i check my code with lint? What if the code containes multiple module? The check is been done on each module separately? What is the command to use the lint Any relevant site??? Thanks a lot. You are doing a great job.:cool: (2 Replies)
Discussion started by: amatsaka
2 Replies
Login or Register to Ask a Question
lint(1B)					     SunOS/BSD Compatibility Package Commands						  lint(1B)

NAME
lint - C program verifier SYNOPSIS
/usr/ucb/lint [options] DESCRIPTION
/usr/ucb/lint is the interface to the BSD Compatibility Package C program verifier. It is a script that looks for the link /usr/ccs/bin/ucblint to the C program verifier. /usr/ccs/bin/ucblint is available only with the SPROcc package, whose default location is /opt/SUNWspro. /usr/ucb/lint is identical to /usr/ccs/bin/ucblint, except that BSD headers are used and BSD libraries are linked before base libraries. The /opt/SUNWspro/man/man1/lint.1 man page is available only with the SPROcc package. OPTIONS
/usr/ucb/lint accepts the same options as /usr/ccs/bin/ucblint, with the following exceptions: -Idir Search dir for included files whose names do not begin with a slash (/) prior to searching the usual directories. The directories for multiple -I options are searched in the order specified. The preprocessor first searches for #include files in the directory containing sourcefile, and then in directories named with -I options (if any), then /usr/ucbinclude, and finally, in /usr/include. -Ldir Add dir to the list of directories searched for libraries by /usr/ccs/bin/ucblint. This option is passed to /usr/ccs/bin/ld. Directories specified with this option are searched before /usr/ucblib and /usr/lib. -Y P, dir Change the default directory used for finding libraries. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. FILES
/usr/lint/bin/ld link editor /usr/lib/libc C library /usr/ucbinclude BSD Compatibility directory for header files /usr/ucblib BSD Compatibility directory for libraries /usr/ucblib/libucb BSD Compatibility C library /usr/lib/libsocket library containing socket routines /usr/lib/libnsl library containing network functions /usr/lib/libelf library containing routines to process ELF object files /usr/lib/libaio library containing asynchronous I/O routines ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
ld(1), a.out(4), attributes(5) SunOS 5.10 1 Feb 1995 lint(1B)