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