473,503 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Utility to verify that all declared functions are defined


C++ lets you declare functions in headers which are actually not
defined in the source code. During a cleanup cycle for a library I
would like to ensure that all free and member functions advertised in
the library header files are actually defined inside the library. I
could imagine a utility which processes the header files and spits out
a piece of code which takes the address of each declared function.
Missing definitions would then show up as linkage errors.

Anybody know if such or a similar utility exists?

TIA
Paavo

May 22 '07 #1
3 1492
Paavo Helde wrote:
C++ lets you declare functions in headers which are actually not
defined in the source code. During a cleanup cycle for a library I
would like to ensure that all free and member functions advertised in
the library header files are actually defined inside the library. I
could imagine a utility which processes the header files and spits out
a piece of code which takes the address of each declared function.
Missing definitions would then show up as linkage errors.

Anybody know if such or a similar utility exists?
If your test suite calls a function that hasn't been implemented you'll
get an error.

--

-- Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." (www.petebecker.com/tr1book)
May 22 '07 #2
On May 22, 5:51 pm, Pete Becker <p...@versatilecoding.comwrote:
Paavo Helde wrote:
C++ lets you declare functions in headers which are actually not
defined in the source code. During a cleanup cycle for a library I
would like to ensure that all free and member functions advertised in
the library header files are actually defined inside the library. I
could imagine a utility which processes the header files and spits out
a piece of code which takes the address of each declared function.
Missing definitions would then show up as linkage errors.
Anybody know if such or a similar utility exists?

If your test suite calls a function that hasn't been implemented you'll
get an error.
That's a good advice and in longer term perspective I am certainly
trying to follow that. However, currently there is no such
comprehensive test suite and too little time left (as always). I have
been cleaning up the code, put the functions in the right namespaces
and regularized the function signatures. This means that the function
might be there and working well as before, but because of slight
changes in namespaces and argument types it is not "connected" to the
header declaration any more. I was hoping there is a handy utility
which just lists me the functions which I have failed to synchronize
properly.

Best regards
Paavo

May 22 '07 #3
pa***@ebi.ee wrote:
On May 22, 5:51 pm, Pete Becker <p...@versatilecoding.comwrote:
>Paavo Helde wrote:
>>C++ lets you declare functions in headers which are actually not
defined in the source code. During a cleanup cycle for a library I
would like to ensure that all free and member functions advertised in
the library header files are actually defined inside the library. I
could imagine a utility which processes the header files and spits out
a piece of code which takes the address of each declared function.
Missing definitions would then show up as linkage errors.
Anybody know if such or a similar utility exists?
If your test suite calls a function that hasn't been implemented you'll
get an error.

That's a good advice and in longer term perspective I am certainly
trying to follow that. However, currently there is no such
comprehensive test suite and too little time left (as always).
Then your project is in deep trouble. Put another way: if you don't have
time to do it right, when will you have time to fix it?

I know that's unsympathetic, but there are far too many managers who
view testing as a nuisance, and don't allow adequate time for it in
their schedules. The result is, of course, lousy software.

--

-- Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." (www.petebecker.com/tr1book)
May 22 '07 #4

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

Similar topics

3
19241
by: Fernando Rodriguez | last post by:
Hi, How can I get the list of all the functions defined in the current module?
2
2791
by: Tian | last post by:
I am python beginner, I have a question about the interdependence of modules. For example, when I have two modules: module1.py ------------- def plus(x): return add(x,1)
5
1915
by: ganesh.gella | last post by:
Hi All, Wanted to make sure on this, I have some functions for which I am providing the definition inside the class definition. (As these are very small functions like get and set). Do i...
26
45468
by: Dave Hammond | last post by:
In document "A.html" I have defined a function and within the document body have included an IFRAME element who's source is document "B.html". In document "B.html" I am trying to call the function...
3
7103
by: Anjali Lourda | last post by:
Hi, I have defined a function in global.asax file. Could somebody please tell me how i am supposed to call that function from the other files of the same project. Global.asax public function...
3
3720
by: CW | last post by:
I find it necessary to mix code-behind and non-code behind techniques sometimes. I have utility functions defined in a VB module. Is there anyway for me to call functions defined in VB module...
0
7199
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
7076
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
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
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.