Peculiar initializers in kjs/date_object.cpp

Adriaan de Groot adridg at cs.kun.nl
Mon Dec 29 14:51:37 GMT 2003


When compiling kjs, tap and I get the following (FreeBSD-current, gcc 3.3):

/mnt/spare/kde/kdelibs/kjs/date_object.cpp:591: warning: missing initializer 
for member `<anonymous struct>::tzOffset'

which looks really weird. The attached patch makes a (n otherwise spurious) 
typedef to get a more coherent warning, and then goes about fixing it. I 
don't know how the exact semantics of array-of-char vs. pointer-to-char goes, 
and for bikeshedding about it, see kde-cafe@, _but_: the initialization of 
tzName from 0 seems to confuse gcc. So let's initialize from { 0,0,0,0 } 
instead. In addition, where the known_zones is used, there's a pointer 
comparison in the for loop (or it looks like it), which to my eye is a weird 
thing to do with char[4]s. So the patched version looks for a NUL character 
instead of a NULL pointer.

OK? Foolish?


-- 
pub  1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <groot at kde.org>
            If the door is ajar, can we fill it with door-jamb?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: date_object.diff
Type: text/x-diff
Size: 1415 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20031229/7e3a6ff9/attachment.diff>


More information about the kde-core-devel mailing list