Fix!?? (__va_copy) [Was: PostgreSQL Exception: invalid input syntax for type timestamp]

Adam Tauno Williams <[email protected]> Fri, 27 Feb 2009 23:16:13 -0500
Newsgroups gmane.comp.cms.opengroupware.user
Message-ID <1235794573.5233.46.camel@linux-m3mt>
> So, boy does this look like a candidate (in PrintfFormatScanner) - 
> 
> <snip>
> if (args == NULL) {
>   /* We got no parameters, so we cannot resolve them anyways. If the
>    * string contains patterns, we should probably raise an error?
>    */
>   return format;
>  }
> </snap>
> 
> - as we are getting exactly out format spec handled back to us.  If I
> toss an fprintf into there it gets pinged!
> 
> PrintfFormatScanner for no args, returning format!
> %b %d %H:%M:%S ogo-webui-1.1 [16973]: Note: folder-view did not find
> Epoz.
> 

A brute force fix is this:  change "#ifdef __va_copy" in
PrintfFormatScanner's stringWithFormat to "#ifndef __va_copy" so instead
of -

if (args == NULL) {
  return format;
 }
 __va_copy(va, args);
 self->result = [NSMutableString stringWithCapacity:[format
cStringLength]];
[self parseFormatString:format context:&va];

 - we get -

va = args;
self->result = [NSMutableString stringWithCapacity:[format
cStringLength]];
[self parseFormatString:format context:&va];

Should __va_copy be defined? (is it getting defined erroneously
somewhere?).  Or is this symptomatic of a bug elsewhere?

Happily I don't see it used terribly many other places:

awilliam@linux-m3mt:~/Works/OpenGroupware/libFoundation-1.1.7> grep -d
recurse __va_copy *
ChangeLog:	  use __va_copy to handle va_list arguments (needed for
powerpc64 port)
Foundation/PrintfFormatScanner.m:#ifndef __va_copy
Foundation/PrintfFormatScanner.m:    __va_copy(va, args);
Foundation/NSSet.m:#ifdef __va_copy
Foundation/NSSet.m:    __va_copy(va, argList);
Foundation/common.h:#  if defined(__va_copy) || defined(__linux__)
Foundation/common.h:#    define lfCopyVA(__lvar__, __avar__)
__va_copy(__lvar__, __avar__);


sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.m:#ifdef __va_copy
sope-gdl1/GDLAccess/FoundationExt/PrintfFormatScanner.m:
__va_copy(va, args);




-- 
OpenGroupware.org Users
[email protected]
http://mail.opengroupware.org/mailman/listinfo/users