473,473 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Extracting undefined identifiers

Hi,
I have a collection of C source files (.c and .h). I need to find
all identifiers which are used in that collection but not defined
within the collection. The identifiers include pre-processor macros/
defines, structure types, and variable/function names. Thus, if a file
uses a symbol A but no file in the collection defines A, then A should
appear in the list.

ctags comes close, but its -x option produces only a list of defined
symbols. The undefined symbols don't appear in the cross-reference.

cscope conveniently builds a database of all identifiers. Is there any
way to coax cscope to print out the undefined symbols?

Thanks very much!

Regards,
Sundar.
Nov 7 '08 #1
2 1891
On Nov 7, 8:41 pm, nd.sun...@gmail.com wrote:
Hi,
I have a collection of C source files (.c and .h). I need to find
all identifiers which are used in that collection but not defined
within the collection. The identifiers include pre-processor macros/
defines, structure types, and variable/function names. Thus, if a file
uses a symbol A but no file in the collection defines A, then A should
appear in the list.

ctags comes close, but its -x option produces only a list of defined
symbols. The undefined symbols don't appear in the cross-reference.

cscope conveniently builds a database of all identifiers. Is there any
way to coax cscope to print out the undefined symbols?
This is quite off-topic. I can't think of an on-topic group.
You said ctags produces a list of defined identifiers, and cscope
produces a database of all the identifiers...
cscope - ctags = what you want.
Nov 8 '08 #2
nd*******@gmail.com wrote:
>
I have a collection of C source files (.c and .h). I need to find
all identifiers which are used in that collection but not defined
within the collection. The identifiers include pre-processor
macros/ defines, structure types, and variable/function names.
Thus, if a file uses a symbol A but no file in the collection
defines A, then A should appear in the list.
Look for a cross-reference tool that can scan a herd of files,
including .h files, and can detect and mark definitions. I used to
have one, but I lost the sources in a disk crash and have never
reworked it. That version usually required recompilation to handle
big sources, which wouldn't be needed today.

This is OT on c.l.c, and I don't know what group to recommend.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
Nov 9 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: bp | last post by:
Hi, Could someone to tell me what I'm doing wrong? I'm using gcc version 3.3.4 and ld version 2.15.90.0.3 20040415 the linker message is: .../obj/classOpenAreaForm.o(.text+0x211): In...
5
by: Michael Powe | last post by:
Hello, I wish to extract some text from certain elements on the page and process them. I've done this in the past by keying on the className but I don't have that option in this case. Below is...
6
by: mark_galeck_spam_magnet | last post by:
Hello, K&R say about the constant expression after #if: "The resulting constant expression is restricted: it must be integral (...)" Clearly, the expression 1 < FOO if FOO is undefined, is...
1
by: Hendrik Wendler | last post by:
Hi everybody, for something like a script interpreter - or better a script assembler - i need a routine, lib or anything that extracts identifiers. what i want to do is assemble short script...
49
by: matty | last post by:
Hi, I recently got very confused (well that's my life) about the "undefined" value. I looked in the FAQ and didn't see anything about it. On...
17
by: yb | last post by:
Hi, Looking for clarification of undefined variables vs. error in JavaScript code. e.g. <script> alert( z ); // this will be an error, i.e. an exception </script>
16
by: Jim Langston | last post by:
I know that functions starting with an underscore, or two underscores, are reserved by the compiler/c++ and should not be used by the user and may cause undefined behavior. My question is, how...
57
by: fctk | last post by:
hello, i'm trying to understand what are the rules for determining when an expression is well defined or not. i found a page (http://c-faq.com/expr/seqpoints.html) which seems to explain this...
45
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.