BIND 10 #1324: Basic DHCP benchmark software framework
BIND 10 Development
do-not-reply at isc.org
Thu Nov 17 15:08:06 UTC 2011
#1324: Basic DHCP benchmark software framework
-------------------------------------+-------------------------------------
Reporter: | Owner: johnd
stephen | Status: reviewing
Type: task | Milestone: Sprint-
Priority: major | DHCP-20111123
Component: | Resolution:
perfdhcp | Sensitive: 0
Keywords: | Sub-Project: DNS
Defect Severity: N/A | Estimated Difficulty: 0
Feature Depending on Ticket: | Total Hours: 0
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Changes (by stephen):
* owner: stephen => johnd
Comment:
> C++ tutorials & previous code review made me think this was preferred.
I've changed it.
You're right about the #define - change it to {{{static const char*
PROGNAME = "perfdhcp";}}}.
> In earlier discussion, among the various options for dealing with this
immediately or later, it was decided that this will remain C code until
perfdhcp is rewritten in C++, at which point it would use some form of C++
runtime initialization.
You're right, we did discuss that back in October, I'd forgotten about
that. The original idea was to try to use one compiler, g++ because the
Google Test code must use C++. But we're abandoning that principle, then
I suppose all files (apart from the test code) could be compiled using the
C compiler. If nothing else, it would emphasise that the code is C
instead of C++.
Why don't we do that then - rename these files back to '.c' files? As far
as I can see, the only changes that will be needed are to:
* Make sure every .h file includes the conditional {{{extern "C" {}}}
brackets around the declarations (only cloptions.h and procconf.h need to
be so modified).
* Take out the {{{const_cast}}} from line 312 of procconf.c
* Change the Makefile.am to refer to the .c files instead of .cc files.
> My inclination is that, if a mechanism exists anyway for propagating up
the details of a failure, to use that mechanism to report even
unrecoverable failures.
The problem there is that every call to a function has to be followed by a
test of the result and, in the case of a failure, the return of the result
to the caller. (That's why modern languages have exception constructs.) As
this will eventually be converted to C++, it's not worth the effort of
changing it. (C++ uses the "new" operator to allocate memory and that
generates an exception on failure.)
'''Other Issues'''[[BR]]
The code failed to build on OS/X due to the non-existence of "malloc.h".
malloc() is defined in stdlib.h, so the include of "malloc.h" should be
removed.
In the case of not passing a value to an option that expects a non-empty
string, the message is:
{{{
perfdhcp: Invalid value given for option <whatever>: expected a non-empty
string, got:
}}}
It looks as if something is expected after "got", whereas the only thing
that could have caused that error is an empty string. (Don't bother to fix
this, we'll address it when we convert the code to C++.)
--
Ticket URL: <http://bind10.isc.org/ticket/1324#comment:15>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list