[Date Prev][Date Next]
(ITS#3839) pedantic and format troubles
Full_Name: Hallvard B Furuseth
Submission from: (NULL) (184.108.40.206)
Submitted by: hallvard
gcc -pedantic -Wformat -Wno-format-extra-args isn't nice to the
ConfigTable.arg_item is set to (void*)integer or (void*)function
when arg_type & (ARG_MAGIC | ARG_OFFSET). This is not portable -
function and void pointers may have different sizes, or pointers
may be normalized in some way after being assigned integers, etc.
This should either be replaced with 3 fields (where only one is set
per table entry), or the current field could be set to a pointer to
a variable containg the current value.
Um. And I guess it's about time to fix the same problem with
ldap_pvt_thread_pool_<setkey/getkey>(). They receive function
pointers sometimes. I'll create some static variables to hold
these function pointers, and pass them pointers to those
ConfigArgs.lineno is an unsigned long, but a number of routines
that can report line numbers (like parse_acl) take an int.
So do a lot of printf formats. I started to fix the formats
that are wrong, but maybe it's just as well to use int lineno.
BTW, if we are going to worry about line numbers too large for an
int, the int* line number in ldif_read_record() seems more urgent.
I'll fix if people want it, but of course that will break anything
which #includes <ldif.h> and uses this function:-(
A ligher change is to make the char* file/mode args to ldif_open()
LDAP_CONST, since they are passed const char*'s from elsewhere.
Two plain bugs in bconfig.c:
Message "%s: (optional) %s overlay \"%s\" configuration failed"
gets the char c->argv instead of c->argv+1 or something.
Message "<%s> cannot be deleted" gets no arg to the %s.
Looks like it should be deleted, since it's repeated below.